user3496827
user3496827

Reputation: 21

Where can I find my Log file?

I have following statements imported in my project:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

and following being written in my class:

private static Log logger = LogFactory.getLog(ClassName.class);

logger.info("BEGIN query");
logger.severe("data is required");

I am running my project in Eclipse, without using server.
Could anyone help me to find out the location where these logs will be written while running the program ?

Upvotes: 1

Views: 378

Answers (1)

Mohsen Kamrani
Mohsen Kamrani

Reputation: 7457

Suppose you have this sample package structure:

enter image description here

And add TestLog class's Edit Configuration under VM arguments likes this:

-Djava.util.logging.config.file=/D:/dev/workspace/LoggingTest/bin/log-config.properties(your properties file path)

enter image description here

And run then you can find your log file under D:/temp/log/test.log

Upvotes: 2

Related Questions