Now as per
http://logback.qos.ch/manual/joran.html , i tried to use file
Appender to log the message to file* but no help*. Here is added code
snippet in logback.xml
<appender name="FILE"
class="ch.qos.logback.core.FileAppender">
<file>myApp.log</file>
<layout class="ch.qos.logback.core.ConsoleAppendert">
<Pattern>%date %level [%thread] %logger{10} [%file:%line]
%msg%n</Pattern>
</layout>
</appender>
<root level="debug">
<appender-ref ref="FILE" />
</root>
---------- Forwarded message ----------
From: mohit gupta <motgupta(a)gmail.com>
Date: Thu, Apr 19, 2012 at 10:06 PM
Subject: Redirecting logs to a file instead of console on tomcat?
To: XWiki Users <users(a)xwiki.org>
I have gone thru
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Logging. As per
logback.xml(inside in MyApp/WEB_INF/classes), looks like it relies on the
fact that container will redirect all the console to logfile automaticcaly.
But it is not happening. I am using tomcat 6. i want to put all the
possible logs i.e log.info.log.warn,log.error,log.debug,log.fatal inside
log file
For logging i am using below code snippet
private static final Log log =
org.apache.commons.logging.LogFactory.getLog(AuthServiceImpl.class);//
declared as insiance variable under AuthServiceImpl.class
then in my public method i am doing the logging as
log.error("Testing AuthServiceImpl Reply = ");
But its printing the logs on tomcat console. Guys really i have no idea
how to print the to file instead of console.Inside logback.xml(inside in
MyApp/WEB_INF/classes)
i can see below setting. I have really no idea what is happening?
Thanks in advance.