[slf4j-user] How to specify location of file to write log message to?

Charles Thomas Charles.Thomas at argodata.com
Thu Apr 19 18:17:00 CEST 2012


Sirs:

I certainly must have overlooked something in the User's Manual and the javadocs looking for the answer to two basic questions.  Please forgive me, if the answers are stated in an obvious place.

First Question - How do I tell slf4j to write log messages from my program to the "C:\Application-Log-Files\App1-Log.txt" file?

Second Question - I see the methods like isDebugEnabled(), but I do not see something like setDebugEnabled(true).  How do I tell slf4j to log debug-level messages?

Thank you,
Charles Thomas

My program:

package com.argo.logtest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class BasicLogging
{

      public static void main(String[] args)
      {
            Logger logger = LoggerFactory.getLogger("com.argo.logTest");

            logger.debug("Msg Num {} was {}", 1, "A debug message.");
            logger.info("Msg Num {} was {}", 2, "An info message.");
            logger.error("Msg Num {} was {}", 3, "An error message.");
            logger.warn("Msg Num {} was {}", 4, "A warning message.");

      }

}

--------------------------------------------------- Confidentiality Notice: This electronic mail transmission is confidential, may be privileged and should be read or retained only by the intended recipient. If you have received this transmission in error, please immediately notify the sender and delete it from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120419/7b8cf6d9/attachment.html>


More information about the slf4j-user mailing list