I'm new to util.logging so this might seem a trivial question to some but anyway here goes..I'm using Java's Util.logger to log messages. I'm trying to declare a logger in a single class and accessing it from other classes for logging messages.
Logger class
package util;
import java.util.logging.*;
public class Logger {
public Logger LOGGER = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
}
I'm trying to access this logger in other class as follows..
package mycode;
import util.Logger;
public class MYcode{
private void test(){
LOGGER.fine("Sample message");
}
}
Compilation Error message..
error: cannot find symbol
[javac]LOGGER.fine("Sample message");
When I'm declaring logger in Mycode class then I'm not getting any error but when declaring it another class I'm getting an error. Any idea where I'm going wrong??