I imagine that there must be a default path where the Logs are saved when using the Java Logger. My questions are two:
1) What is that default route?
2) How do I specify a different one?
I am not using any external library (log4j), just Java 1.8.
import java.util.logging.Level;
import java.util.logging.Logger;
1) The default path can be found defined in the logging.properties file located in the \jre\lib directory of your Java installation, example:
inside shows the path:
2) To save the log in a specific path you can use this script that uses the Logger class in which you will define the name and the path where the Log would be saved:
You can later add the messages to your .log file using
logger.info()
, for example:In your log file, this information would be saved: