SD-WAN

 View Only
Expand all | Collapse all

Logger Failure : Not able to log messages.

This thread has been viewed 0 times
  • 1.  Logger Failure : Not able to log messages.

    Posted Feb 26, 2015 10:39 AM

    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



  • 2.  RE: Logger Failure : Not able to log messages.

    Posted Jun 29, 2015 05:01 PM

    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.