Clément Guillaume | 1 Aug 03:18 2014

Custom ConfigurationFactory not loaded

Hi,

I'm trying to use a custom ConfigurationFactory. I created and annotated it
with a  <at> Plugin and an  <at> Order like this:

 <at> Plugin(category = "ConfigurationFactory", name =
"StartupConfigurationFactory")
 <at> Order(10)
public class StartupConfigurationFactory extends ConfigurationFactory{
...
}

But it is never loaded (none of the 2 methods are called).

If I specify the system property "log4j.configurationFactory" with the name
of my class before creating a logger, my factory is successfully loaded.

Did I made a mistake declaring my ConfigurationFactory ?

Clément
Marco Cosentino | 31 Jul 18:13 2014
Picon

log4j 2.0 - About StatusLogger logging level and console output

Hi,
I'm trying to get log4j 2.0 debug information printed out in the console 
but I couldn't manage to get them.
In log4j 1.x you would set the system property "log4j.debug".

I thought that the mechanism was similar in log4j 2.x and apparently it 
should be by setting
log4j2.StatusLogger.level=DEBUG

Still nothing, so I dug a little bit in the code and found that the 
StatusLogger logs its messages either to the listeners (if there's at 
least one) or to a SimpleLogger (logger) which is initialized in the 
constructor (method StatusLogger#logMessage()).

I found that there was a JMX listener registered so I disabled JMX beans 
with
log4j2.disable.jmx=true
but still no luck: the messages don't appear in the console.

I noticed though that the constructor might be the source of the problem:

     private StatusLogger() {
         this.logger = new SimpleLogger("StatusLogger", Level.ERROR, 
false, true, false, false, Strings.EMPTY, null, PROPS,
             System.err);
         this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, 
Level.WARN).intLevel();
     }

The SimpleLogger is initialized using level ERROR therefore the 
(Continue reading)

Ralph Goers | 31 Jul 16:56 2014
Picon

Re: DefaultRolloeverStrategy

No, it does not matter.

Sent from my iPad

> On Jul 31, 2014, at 7:31 AM, Mariano Gonzalez <mariano.l.gonzalez <at> gmail.com> wrote:
> 
> Thank you Remko and Ralph! That clarifies a lot. Then I have to ask, if my
> pattern only contains a %d, what value should I use as max value? Does it
> matter at all?
> 
> Thanks!
> 
> 
>> On Wed, Jul 30, 2014 at 8:23 PM, Remko Popma <remko.popma <at> gmail.com> wrote:
>> 
>> I stand corrected. Thanks, Ralph!
>> 
>> Sent from my iPhone
>> 
>>> On 2014/07/31, at 8:14, Ralph Goers <ralph.goers <at> dslextreme.com> wrote:
>>> 
>>> Remko, that is not exactly correct.  If you specify %i in the
>> filePattern once the max value is hit the oldest file that matches the
>> complete pattern will be deleted automatically.  The issue you are speaking
>> of is that when the pattern includes a date via %d we will not delete files
>> from previous dates.
>>> 
>>> If the pattern only contains %d and does not contain %i then the files
>> will never be deleted by Log4j.
>>> 
(Continue reading)

sujatha rdn | 31 Jul 11:54 2014

mbean for changing log level for log4j2

Hi,

We use log4j2 along with slf4j in our application. And now we try to change
log level dynamically.

Can you please provide me the mbean details so that we can change the log
level during run time via jmx. For this we need to use jolokia(it’s a
remote JMX with JSON over http)

Thanks & Regards,

Sujatha
Mariano Gonzalez | 30 Jul 21:30 2014
Picon

DefaultRolloeverStrategy

Hello,

I'm configuring a RollingFileAppender programatically, using a
TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So far
so good, but is there a way to provide a RolloeverStrategy which renames
the files but never deletes them?

Thanks!
Mike Calmus | 29 Jul 14:47 2014

problems with web app and JndiContextSelector

I am having problems moving our web app over to Log4j 2.0 using JNDI
lookups. I followed the configuration documentation and am not getting any
errors, but nothing is being logged to my configured appenders. Weirdly, if
I remove the JNDI env-entry configuration from web.xml logging seems to
work, albeit with the expected NameNotFoundException in the server output.

One possibly relevant configuration difference is that we load the log4j
jar files as part of server startup so each app doesn't have to load them.

Any ideas? What configuration can I provide to help troubleshoot?

Thanks.
chouaffe frannck-edmond | 29 Jul 10:18 2014
Picon

RollingFileAppender

Hi Guys,

I have been struggling to get my log4j.xml file working as intended. 
I expect the log files rollover once the 100KB size has been reached. However the log4j does write in
multiple log file simultaniously.

How can this be? I would expect log4j to write to a single until the maxfilesize is reached. The file will then
be backed up and so on.

I really need some inputs of yours

Thanks
 
Edmond Chouaffé 
Liav Elias | 29 Jul 07:29 2014

RollingFile appender in tomcat 7 with log4j2

Hi,

I am trying to configure RollingFile appender in tomcat 7 with log4j2 with 5 log files.
I am using in the filePattern the ${sys:catalina.base} but in the log I see the error:

ERROR Unable to create directory C:\eclipse\    omcat7\logs

The same happen if I run tomcat from outside the eclipse (path is different but still there is space in the path).
When I use a path which is hardcoded (C:/temp) it works.
I also tried it with catalina.base and I get the same result.
The interesting part is that the first log file (without a number) is created ok under tomcat/logs - which
means it succeeds to map the filename attribute to a real path
Here is the full appender I use:

<RollingFile name="MyLogFile" fileName="${sys:catalina.home}/logs/MyLog.log"
                 filePattern="${sys:catalina.home}/logs/MyLog-%i.log">
      <PatternLayout>
        <Pattern>%d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c{3} %x - %m%n</Pattern>
      </PatternLayout>
      <Policies>
        <SizeBasedTriggeringPolicy size="10KB"/>
      </Policies>
      <DefaultRolloverStrategy max="5" min="1"/>
</RollingFile>

Thanks for the help,
Liav
This email and any files transmitted with it are confidential material. They are intended solely for the
use of the designated individual or entity to whom they are addressed. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination, use, distribution or copying of
(Continue reading)

jfloviou | 24 Jul 11:59 2014
Picon

Re: Flume Appender

Hi all,

I'm digging out this Thread from December 2012 as i would like to get fresh
thoughts on these questions.

Before reading the discussion i was also hesitating between a Flume Embedded
Agent or a Flume Appender after and Asynch Appender.
Ralph performance output were very interesting but i feel like he compared
Embedded agent vs Flume Appender without Asynch, with of course great
advantage to the Embedded Agent.

=> Did anybody get to the same question and has fresh thoughts on this topic
?

Best regards

Jeff

--
View this message in context: http://apache-logging.6191.n7.nabble.com/Flume-Appender-tp7089p49684.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
David KOCH | 24 Jul 11:25 2014

Routing based on marker value

Note: Re-send, I got a mail error the first time round. Excuse if
doubly-received.

Hi,

I want to dynamically route to different collections based on the
marker I send with a message in a logger.info(Marker marker, String
string) call. I have no problem doing the equivalent with the thread
context by using ${ctx:key}. However, how can I accomplish the same
based on the marker value, say by using ${marker}?

I wrote a custom marker context which I include below, however it
doesn't really make sense since there are no keys in the marker,
http://pastebin.com/dgEYEfnQ and it does not work either.

Thanks,

/David
Kari Arvonen | 23 Jul 17:36 2014
Picon

How to get Log4j2, Tomcat and Chainsaw work together?

Hello,

Versions:
- Apache Log4j2 2.0 release version
- Apache Tomcat 7.0.54
- Apache Chainsaw 2.1 snapshot (http://people.apache.org/~sdeboy/)
- Oracle Java SE 7 u60 JDK

I have tried to get the XMLLayout to work with Log4j2 assuming it is the
best format for Chainsaw. What is preferred way to do this?

In any case current log4j2.xml placed in one of the Webapps WEB-INF\classes
-directory
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="ALL">
  <Appenders>
    <File name="XmlFile" fileName="logs/0000Atest.log"
immediateFlush="true" append="true">
      <XMLLayout complete="true" charset="UTF-8" compact="false"/>
    </File>
  </Appenders>

  <Loggers>
    <AsyncRoot level="ALL" includeLocation="false">
      <AppenderRef ref="XmlFile"/>
    </AsyncRoot>
  </Loggers>
</Configuration>

Configuration is read properly. Where I have been struggling is which jars
(Continue reading)


Gmane