logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter DePasquale <peter.depasqu...@gmail.com>
Subject Re: Correct location for log4j2.xml file in war?
Date Sun, 04 Nov 2012 14:11:04 GMT
Thanks. I'll try that now.  Is there an easy way to make the config
switchable depending on the run time environment? I'm trying to use one log
config file for local execution through a jar file, and also to support
deployment via Tomcat.  Or is the easiest thing to have two separate log
config files, one for each type of execution?


On Sun, Nov 4, 2012 at 9:08 AM, Ralph Goers <ralph.goers@dslextreme.com>wrote:

> With status set to debug you should see it processing the whole
> configuration. It defaults to error so you should have had just these error
> messages before.
>
> You would use a system property to specify the directory, such as
> fileName="${sys:catalina.home}/logs/trace-drivers.txt"
>
>
> On Nov 4, 2012, at 5:53 AM, Peter DePasquale wrote:
>
> > Done. Same result, but the tomcat catalina.out log file is now showing me
> > lines like:
> > 2012-11-04 08:49:18,807 ERROR FileManager (trace-drivers.txt)
> > java.io.FileNotFoundException: trace-drivers.txt (Permission denied)
> >
> > I'm not sure where the log output file is attempting to be created, but
> I'm
> > thinking that is the cause of the subsequent failure to obtain the
> logger.
> > (Earlier shown error messages are the same.)
> >
> > How should I reference the log file creation location in the logger
> config?
> >
> >
> >
> > On Sun, Nov 4, 2012 at 8:40 AM, Ralph Goers <ralph.goers@dslextreme.com
> >wrote:
> >
> >> I don't see anything obviously wrong and it seems to be fine with
> trunk. I
> >> will have to try again later with beta2.  Can you add status="DEBUG" to
> the
> >> configuration element?
> >>
> >> Ralph
> >>
> >> On Nov 4, 2012, at 5:04 AM, Peter DePasquale wrote:
> >>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <configuration>
> >>>
> >>> <appenders>
> >>> <Console name="Console" target="SYSTEM_ERR">
> >>> <PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} -
> >> %msg%n"/>
> >>> </Console>
> >>>
> >>> <File name="drivers" fileName="trace-drivers.txt"
> >>> suppressExceptions="false" append="false">
> >>> <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p %C [%t] - %m%n"/>
> >>> </File>
> >>>
> >>> <File name="analyzers" fileName="trace-analyzers.txt"
> >>> suppressExceptions="false" append="false">
> >>> <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %p %C [%t] - %m%n"/>
> >>> </File>
> >>> </appenders>
> >>> <loggers>
> >>> <root level="error">
> >>> <appender-ref ref="Console"/>
> >>> </root>
> >>>
> >>> <logger name="org.comtor" level="trace" additivity="false">
> >>> <appender-ref ref="drivers"/>
> >>> </logger>
> >>>
> >>> <logger name="org.comtor.analyzers" level="trace" additivity="false">
> >>> <appender-ref ref="analyzers"/>
> >>> </logger>
> >>>
> >>> </loggers>
> >>> </configuration>
> >>>
> >>>
> >>>
> >>> On Sun, Nov 4, 2012 at 8:02 AM, Ralph Goers <
> ralph.goers@dslextreme.com
> >>> wrote:
> >>>
> >>>> Can you just paste it in the email? What is at the link isn't really
> >>>> readable.
> >>>>
> >>>> Ralph
> >>>>
> >>>> On Nov 4, 2012, at 3:14 AM, Peter DePasquale wrote:
> >>>>
> >>>>> Details:
> >>>>>
> >>>>> Log4j2 release: beta2
> >>>>> Apache Tomcat/7.0.26 JVM version: 1.6.0_24-b24
> >>>>> Config file viewable at:
> >>>>> https://snipt.net/embed/3fc48278d07619c37164260069d77a1b/
> >>>>>
> >>>>>
> >>>>> On Sun, Nov 4, 2012 at 12:55 AM, Ralph Goers <rgoers@apache.org>
> >> wrote:
> >>>>>
> >>>>>> Please post your configuration,  what release are you using?
> >>>>>>
> >>>>>> Ralph
> >>>>>>
> >>>>>> On Nov 3, 2012, at 6:58 PM, Peter DePasquale <
> >>>> peter.depasquale@gmail.com>
> >>>>>> wrote:
> >>>>>>
> >>>>>>> Thanks.  Now I'm getting the following at run time:
> >>>>>>>
> >>>>>>> java.lang.NullPointerException
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:591)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:454)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(BaseConfiguration.java:152)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConfiguration.java:110)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:251)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:267)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:134)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
> >>>>>>>
> >>>>>>
> >>>>
> >>
> org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:30)
> >>>>>>> org.apache.logging.log4j.LogManager.getLogger(LogManager.java:129)
> >>>>>>> org.comtor.drivers.ComtorStandAlone.<clinit>(Unknown
Source)
> >>>>>>> org.comtor.cloud.CloudUpload.doPost(Unknown Source)
> >>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
> >>>>>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
> >>>>>>>
> >>>>>>> I see this occurred previously on the user mailing list
(see
> >>>>>>>
> >>>>>>
> >>>>
> >>
> http://mail-archives.apache.org/mod_mbox/logging-log4j-user/201208.mbox/%3CCAAqLGLM9wDzS_2VNJx8T0Xes1bCy9SrLUD0AUE44CE2svb=9KQ@mail.gmail.com%3E
> >>>>>> ),
> >>>>>>> but I don't see what I may need to correct it.  I'm assuming
my
> >> log4j2
> >>>>>>> jar files are in the correct location, since we're seeing
a stack
> >>>>>>> trace here from the org.apache.logging area...
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On Sat, Nov 3, 2012 at 9:43 PM, Pat Farrell <pfarrell@pfarrell.com
> >
> >>>>>> wrote:
> >>>>>>>
> >>>>>>>> On 11/3/12 9:30 PM, Peter DePasquale wrote:
> >>>>>>>>
> >>>>>>>>> I'm trying to deploy an war file to Tomcat7. No
matter where I
> >> place
> >>>>>> the
> >>>>>>>>> log4j2.xml file (within the war, or elsewhere in
the Tomcat7
> >>>>>> ecosystem), I
> >>>>>>>>> get zero logged output (including error statements).
> >>>>>>>>>
> >>>>>>>>> What is the proper configuration for this?
> >>>>>>>> It goes in the classes directory under your WEB-INF
directory,
> >> inside
> >>>>>> the
> >>>>>>>> WAR
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Pat Farrell
> >>>>>>>> http://www.pfarrell.com/
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>
> ------------------------------**------------------------------**---------
> >>>>>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@**
> logging.apache.org
> >> <
> >>>>>> log4j-user-unsubscribe@logging.apache.org>
> >>>>>>>> For additional commands, e-mail: log4j-user-help@logging.**
> >> apache.org
> >>>> <
> >>>>>> log4j-user-help@logging.apache.org>
> >>>>>>>
> >>>>>>>
> >>>>>>> --
> >>>>>>> Peter J. DePasquale, Ph.D.
> >>>>>>> Department of Computer Science
> >>>>>>> The College of New Jersey
> >>>>>>> (e) depasqua [at] tcnj [dot] edu
> >>>>>>> (p) 609-771-2806
> >>>>>>> (f) 609-637-5190
> >>>>>>> (o) Holman Hall - Room 238
> >>>>>>> (l) Holman Hall - Room 255
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >>>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> Peter J. DePasquale, Ph.D.
> >>>>> Department of Computer Science
> >>>>> The College of New Jersey
> >>>>> (e) depasqua [at] tcnj [dot] edu
> >>>>> (p) 609-771-2806
> >>>>> (f) 609-637-5190
> >>>>> (o) Holman Hall - Room 238
> >>>>> (l) Holman Hall - Room 255
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>> --
> >>> Peter J. DePasquale, Ph.D.
> >>> Department of Computer Science
> >>> The College of New Jersey
> >>> (e) depasqua [at] tcnj [dot] edu
> >>> (p) 609-771-2806
> >>> (f) 609-637-5190
> >>> (o) Holman Hall - Room 238
> >>> (l) Holman Hall - Room 255
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>
> >>
> >
> >
> > --
> > Peter J. DePasquale, Ph.D.
> > Department of Computer Science
> > The College of New Jersey
> > (e) depasqua [at] tcnj [dot] edu
> > (p) 609-771-2806
> > (f) 609-637-5190
> > (o) Holman Hall - Room 238
> > (l) Holman Hall - Room 255
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Peter J. DePasquale, Ph.D.
Department of Computer Science
The College of New Jersey
(e) depasqua [at] tcnj [dot] edu
(p) 609-771-2806
(f) 609-637-5190
(o) Holman Hall - Room 238
(l) Holman Hall - Room 255

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message