0

次のエラーが表示されます。

1 error found:
File: C:\Users\adem\Desktop\various_topics\JavaProjects\log4jExample.java  [line: 15]
Error: cannot find symbol
  symbol:   method getLogger(java.lang.String)
  location: interface org.apache.logging.log4j.Logger

そして、これがこのチュートリアルに基づいた私のコードです:

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.*;

public class log4jExample{

  /* Get actual class name to be printed on */
  static Logger log = Logger.getLogger(log4jExample.class.getName());   //.getName()
  public static void main(String[] args)
    throws IOException,SQLException{

    log.debug("Hello this is an debug message");
    log.info("Hello this is an info message");
  }
}

ありがとう!

4

1 に答える 1