Software Defined Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Logger Failure : Not able to log messages.

 
Occasional Advisor

Logger Failure : Not able to log messages.

Hi All,

 

I'm using logger  to log files and i'm not able to see any messages in the log files,

 

Below are the 2 log files I am looking in,

 

/opt/sdn/virgo/serviceability/logs/log.log

/var/log/sdn/virgo/logs/log.log

 

Followed the steps provided in pdf for logger at page 100 "Debugging with logs".

 

Below is what I followed, line,

 

logger.info("Chethan  Device {} added", device);

 

I am looking for at least my name,

 

Please let me know is there any other log files to look-in or am I missing some thing.

 

Thank you in advance,,

 

Regards,

Chethan

1 REPLY 1
Advisor

Re: Logger Failure : Not able to log messages.

If you instantiate your logger as follows:

 

private org.slf4j.Logger logger = LoggerFactory.getLogger(getClass());

and log information in your event() method as follows:

 

logger.info("Chethan Device {} added");

you should see "Chethan Device {} added" in

 

/opt/sdn/virgo/serviceability/logs/log.log

whenever your app's event() method is triggered. You should be able to grep the results to filter the log and find lines with your name.