logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thad Humphries <thad.humphr...@gmail.com>
Subject Re: Jar in WEB-INF/lib not logging
Date Wed, 30 Sep 2015 02:51:45 GMT
The default config file (src/main/resources/log4j2-dev.xml) looks like

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug" strict="true" name="thadGwt"
               monitorInterval="10">

  <Properties>
    <Property name="logpath">/Users/thad/temp</Property>
  </Properties>

  <Appenders>
    <RollingFile name="RollingFile" fileName="${logpath}/gwtapp.log"
        filePattern="${logpath}/gwtapp_%d{yyyy-MM-dd}.log">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level
%logger{1}.%method() - %msg%n"/>
      <Policies>
        <TimeBasedTriggeringPolicy />
      </Policies>
      <DefaultRolloverStrategy max="20"/>
    </RollingFile>
  </Appenders>

  <Loggers>
    <Logger name="com.thad.gwtapp.server" level="debug" additivity="true">
      <AppenderRef ref="RollingFile"/>
    </Logger>
  </Loggers>

</Configuration>

The class was com.thad.gwtapp.server.ImageToPdf but is now
com.thad.image.utils.ImageToPdf. When I run the webapp in Eclipse, logs for
com.thad.gwtapp.server.* are there, but not com.thad.image.utils.ImageToPdf.

Nothing but /Configuration/Loggers/Logger/@name holds that servlet package
name, and (AFAIK) that is not required--name can be whatever I want. I
tried adding a similar <Logger> but with com.thad.image.utils, and tried
adding /Configuration/@name = "com.thad.gwtapp.server,
com.thad.image.utils".

On Tue, Sep 29, 2015 at 10:13 PM, Ralph Goers <ralph.goers@dslextreme.com>
wrote:

> If you could provide some kind of sample with the configuration that would
> help.
>
> Ralph
>
> > On Sep 29, 2015, at 6:42 PM, Thad Humphries <thad.humphries@gmail.com>
> wrote:
> >
> > Yes, the package name changed. I've not found where to put that in my
> > configuration file. I've tried the package attribute to <Configuration>
> > (oh, but that is for plugins) and I've tried adding a second <Logger>
> with
> > the new package as the name attribute and referencing the same Appender.
> > Neither work. When I Google this, I get *lots* of Log4j 1 suggestions,
> but
> > nothing for version 2.
> >
> > On Tue, Sep 29, 2015 at 8:59 PM, Ralph Goers <ralph.goers@dslextreme.com
> >
> > wrote:
> >
> >> By changing the package name did you cause the Logger name to change?
> Do
> >> you have that logger name configured so that it will log?
> >>
> >> Ralph
> >>
> >>> On Sep 29, 2015, at 4:37 PM, Thad Humphries <thad.humphries@gmail.com>
> >> wrote:
> >>>
> >>> I am using Log4j 2.4 to log server actions in my webapp. The logging
> >> calls
> >>> from WEB-INF/classes are appearing in the webapp's log as expected.
> >> Today I
> >>> extracted a class from the webapp, built it in a separate package, and
> >>> added a JAR with that package to WEB-INF/lib. Although the logging is
> the
> >>> same as before, I no longer see output from this class my webapp's log.
> >> Is
> >>> it possible capture this log information with Log4j 2.4? If so, how?
> >>>
> >>> --
> >>> "Hell hath no limits, nor is circumscrib'd In one self-place; but where
> >> we
> >>> are is hell, And where hell is, there must we ever be" --Christopher
> >>> Marlowe, *Doctor Faustus* (v. 121-24)
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>
> >>
> >
> >
> > --
> > "Hell hath no limits, nor is circumscrib'd In one self-place; but where
> we
> > are is hell, And where hell is, there must we ever be" --Christopher
> > Marlowe, *Doctor Faustus* (v. 121-24)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)

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