Get error as
"java.io.IOException: Couldn't get lock for ..\log\abc.log", not sure why this happen.
Can somebody help me out? Thank you
logger = LogManager.getLogManager().getLogger(className);
FileHandler logFile = new FileHandler(file);
// create txt Formatter
SimpleFormatter formatterTxt = new SimpleFormatter();
logFile.setFormatter(formatterTxt);
logger.addHandler(logFile);
@Catheryan
I also had the same issue. For me issue was:
private static final String FILE_PATH="/home/jeril/Logs.log";
handler = new FileHandler(FILE_PATH);
FILE_PATH was WRONG