title: How to solve - ERROR StatusLogger No Log4j 2 configuration file found
body: <p>Using Intellij I am getting the error below when running in the IDE -</p>
  
  <blockquote>
    <p>ERROR StatusLogger No Log4j 2 configuration file found. Using default
    configuration (logging only errors to the console), or user
    programmatically provided configurations. Set system property
    'log4j2.debug' to show Log4j 2 internal initialization logging. See
    <a href="https://logging.apache.org/log4j/2.x/manual/configuration.html" rel="nofollow noreferrer">https://logging.apache.org/log4j/2.x/manual/configuration.html</a> for
    instructions on how to configure Log4j 2</p>
  </blockquote>
  
  <p>When I run the jar file - </p>
  
  <blockquote>
    <p>trevor@trevor-Lenovo-YOGA-510-14AST:~/decent/Master5/out/artifacts/Master5_main_jar$
    java -jar Master5.main.jar  Exception in thread "main"
    java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory   at
    BlockgetConnection.(BlockgetConnection.java:12)   at
    BlockgetAccount.getAccountByName(BlockgetAccount.java:31)     at
    BlockgetStart.main(BlockgetStart.java:8) Caused by:
    java.lang.ClassNotFoundException: org.slf4j.LoggerFactory     at
    java.net.URLClassLoader.findClass(URLClassLoader.java:382)    at
    java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at
    sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)     at
    java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 3 more</p>
  </blockquote>
  
  <p>I am not explicitly logging and I assume in the Decent logic there is a need to log somehow. I included my build.gradle. I have included some dependencies for logging. Any idea about the solution?</p>
  
  <p>Code (main class) - </p>
  
  <pre><code>import ch.decent.sdk.model.Account;
  
  public class BlockgetStart {
  
  
      public static void main(String[] args) {
          BlockgetAccount anAccount = new BlockgetAccount();
          Account myAcct = anAccount.getAccountByName("trevor3");
      }
  
  }
  </code></pre>
  
  <p>Instance of this class used -</p>
  
  <pre><code>import ch.decent.sdk.DCoreApi;
  import ch.decent.sdk.crypto.Address;
  import ch.decent.sdk.crypto.Credentials;
  import ch.decent.sdk.model.Account;
  import ch.decent.sdk.model.AssetAmount;
  import ch.decent.sdk.model.Fee;
  import ch.decent.sdk.model.TransactionConfirmation;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  import org.apache.logging.log4j.Logger;
  import org.apache.logging.log4j.LogManager;
  
  @Component
  public class BlockgetAccount {
      // connection to accounts
      private static final Long AMOUNT_OF_DCT_REQUIRED_FOR_CREATION = 100000L;
  
      @Autowired
      private BlockgetConnection connectionExample;
      @Autowired
      private BlockgetLogin loginExample;
      @Autowired
      private BlockgetGenerateKeys generateKeys;
  
      /**
       * Example of getting any account by its name.
       *
       * @param accountName name of the account e.g. dw-account
       * @return Account instance for given account name
       */
      public Account getAccountByName(String accountName) {
  
          connectionExample = new BlockgetConnection();
          final DCoreApi dcoreApi = connectionExample.connect();
  
          return dcoreApi
                  .getAccountApi()
                  .getByName(accountName)
                  .blockingGet();
      }
  
      /**
       * Example of account creation with initial fee.
       *
       * @param newAccountName Unique account name that you wish to create.
       * @return Confirmation about transaction
       */
      public TransactionConfirmation createAccount(String newAccountName) {
  
          final DCoreApi dcoreApi = connectionExample.connect();
          final Credentials credentials = loginExample.login();
          final Address newAccountPublicKey = generateKeys.generateKeys();
          final AssetAmount dctAssetAmount = new AssetAmount(AMOUNT_OF_DCT_REQUIRED_FOR_CREATION);
          final Fee initialFee = new Fee(dctAssetAmount.getAssetId(), AMOUNT_OF_DCT_REQUIRED_FOR_CREATION);
  
          return dcoreApi.getAccountApi().create(
                  credentials,
                  newAccountName,
                  newAccountPublicKey,
                  initialFee
          ).blockingGet();
      }
  }
  </code></pre>
  
  <p>Build.gradle -</p>
  
  <pre><code>plugins {
      id 'java'
  }
  
  group 'com.blockget.Master5'
  version '1.0-SNAPSHOT'
  
  sourceCompatibility = 1.8
  
  jar { manifest { attributes 'Main-Class': 'BlockgetStart' } }
  
  allprojects {
      repositories {
          mavenCentral()
          maven { url 'https://jitpack.io' }
      }
  }
  
  dependencies {
      // https://mvnrepository.com/artifact/org.springframework/spring-context
      // https://mvnrepository.com/artifact/org.springframework/spring-context
      compile group: 'org.springframework', name: 'spring-context', version: '5.1.8.RELEASE'
      // https://mvnrepository.com/artifact/org.slf4j/slf4j-ap
      compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26'
  // https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j-impl
      compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.12.0'
  
      testCompile group: 'junit', name: 'junit', version: '4.12'
      implementation 'com.github.DECENTfoundation:DCoreKt-SDK:2.3.1'
  
  }
  </code></pre>
  
  <p>I get this for the jar breakdown - </p>
  
  <pre>
      trevor@trevor-Lenovo-YOGA-510 
      14AST:~/decent/Master5/out/artifacts/Master5_main_jar$ jar tf 
      Master5.main.jar 
      META-INF/MANIFEST.MF
      META-INF/
      BlockgetNftMgr.class
      BlockgetLogin.class
      BlockgetConnection.class
      BlockgetNft.class
      BlockgetStart.class
      BlockgetAccount.class
      BlockgetGenerateKeys.class
  
  
  </pre>
  
  <p>Should Logger be in here?</p>