Emi Lu | 25 May 17:39 2015
Picon
Picon

log4j2 for java 1.6.x?

Hello List,

Does log4j2 support for java version 1.6.x please?

Thanks a lot!
Gary Gregory | 22 May 20:58 2015
Picon

Re: SizeBasedTriggeringPolicy for HTMLLayout ?

Try using a filePattern in your RollingFile.

If that does not work, I think you'll need to give us a lot more details.
Log4j version and versions of other relevant components. You complete
config and so on.

Gary

On Fri, May 22, 2015 at 10:55 AM, Emi Lu <emilu <at> encs.concordia.ca> wrote:

>  On 05/22/2015 01:46 PM, Gary Gregory wrote:
>
> I do not see why this should not work. What happens when you try?
>
>   The file cannot even be generated through tomcat 6.0.41. The log file
> is generated/updated only if I change
> <RollingFile ...> to <File ...>.
>
> But RollingFile won't work.
>
> Thanks
>
>
>
> On Fri, May 22, 2015 at 10:38 AM, Emi Lu <emilu <at> encs.concordia.ca> wrote:
>
>> Hello,
>>
>> Is there a way to use RollingFile and SizeBasedTriggeringPolicy for
>> HTMLLayout please?
(Continue reading)

Emi Lu | 22 May 19:38 2015
Picon
Picon

SizeBasedTriggeringPolicy for HTMLLayout ?

Hello,

Is there a way to use RollingFile and SizeBasedTriggeringPolicy for 
HTMLLayout please?

For example:

     <appenders>
       <RollingFile name="debug_html" fileName="log.html">
          <HTMLLayout charset="UTF-8" />
         <Policies>
            <SizeBasedTriggeringPolicy size="1 KB" />
         </Policies>
      </RollingFile>
    </Appenders>

    <Loggers>
    <Logger name="test.pkg" level="info" additivity="false">
       <AppenderRef ref="debug_html" />
    </Logger>
    <Root level="error">
       <AppenderRef ref="Console" />
    </Root>

    </Loggers>

Thanks a lot!
Mikael Ståldal | 21 May 19:08 2015

Errors when using XMLLayout

When trying to use XMLLayout, I get this error.

Using Log4j 2.3 and these additional runtime dependecies:
"com.fasterxml.jackson.core" % "jackson-core" % "2.5.3"

"com.fasterxml.jackson.dataformat" %  "jackson-dataformat-xml" % "2.5.3"

2015-05-21 19:04:47,283 ERROR
com.fasterxml.jackson.databind.JsonMappingException: Not implemented
(through reference chain:
org.apache.logging.log4j.core.impl.Log4jLogEvent["Message"])
com.fasterxml.jackson.databind.JsonMappingException: Not implemented
(through reference chain:
org.apache.logging.log4j.core.impl.Log4jLogEvent["Message"])
        at
com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:210)
        at
com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:177)
        at
com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:190)
        at
com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerBase.serializeFieldsFiltered(XmlBeanSerializerBase.java:295)
        at
com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializer.serialize(XmlBeanSerializer.java:117)
        at
com.fasterxml.jackson.dataformat.xml.ser.XmlSerializerProvider.serializeValue(XmlSerializerProvider.java:92)
        at
com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1052)
        at
com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:923)
(Continue reading)

Mikael Ståldal | 19 May 17:10 2015

Translating log levels

Is it possible to translate log levels in the configuration.

I have some 3rd party libraries who log stuff on too high level, so I would
need a way to say that logging from "com.somecompany.funlibrary" on level
ERROR should be translated to WARN.

--

-- 
[image: MagineTV]

 *Mikael Ståldal*
Senior backend developer

 *Magine TV*
 mikael.staldal <at> magine.com
 Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

 Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.
Mikael Ståldal | 11 May 10:24 2015

XMLLayout dependencies

Which library dependencies do I need to use the XMLLayout? Is this
documented somewhere?

--

-- 
[image: MagineTV]

 *Mikael Ståldal*
Senior backend developer

 *Magine TV*
 mikael.staldal <at> magine.com
 Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

 Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.
Markward Schubert | 8 May 11:52 2015
Picon

JDK8 Problem

Dear Group,

I have a problem with the JDK Loggin Adapter and JDK 8.0.45.

In a tiny testprogram I open an HttpURLConnection and download a file.
In order to do some testing, I managed to configure the Adapter as
described here: http://logging.apache.org/log4j/2.x/log4j-jul/index.html
and had a result as expecte.

Specifically I pass the
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager word to
the run command of the jar.

The problem is, that this only worked with some older 7 JDK (7.0.40) I
guess.
When I then moved to a more recent JDK, the JRE Logging does not get
through to my logfile.
In the latter case only the logging from my own code appears in the file.
Not the logging of HttpURLConnection.

Is there some special precondition for using the JDK Logging Adapter with a
JDK 8.x?

Regards,
Markward
Mikael Ståldal | 8 May 10:51 2015

ThreadContext vs asynchronous app

I have an asynchronous web app (in Scala based on Twitter Finagle, not
using Servlet API).

I use Log4j 2.2 for logging, and I want to tag log messages with some
information about requests (such as client IP address and authenticated
user ID).

In a synchronous Servlet based web app, you can use Log4j's TheradContext
for this, but it doesn't work in Finagle's asynchronous environment since
there is no correlation between threads and requests.

How can I do this?

--

-- 
[image: MagineTV]

 *Mikael Ståldal*
Senior backend developer

 *Magine TV*
 mikael.staldal <at> magine.com
 Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

 Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.
(Continue reading)

Mikael Ståldal | 6 May 17:45 2015

Incorrectly defined compressionType parameter to GelfLayout

I think there is a bug in GelfLayout.

The compressionType parameter does not work, and I can see why in the
source:

 <at> PluginAttribute(value = "compressionThreshold",
    defaultString = "GZIP") final CompressionType compressionType,

The value is wrong here.

--

-- 
[image: MagineTV]

 *Mikael Ståldal*
Senior backend developer

 *Magine TV*
 mikael.staldal <at> magine.com
 Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

 Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.
N Jamkhande | 5 May 23:42 2015
Picon

JmxRuntimeInputArgumentsLookup security permission

I am trying to use Log4j2 in my webapp which runs in Tomcat which has its
Security policy enabled.

While initial load of Log4j2 via Commons logging bridge I keep getting -

java.lang.NoClassDefFoundError: Could not initialize class
org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup

I have narrowed it down to the initialisation code of the class

static {

        final List<String> argsList =
ManagementFactory.getRuntimeMXBean().getInputArguments();

        JMX_SINGLETON = new
JmxRuntimeInputArgumentsLookup(MapLookup.toMap(argsList));
}

Where this code needs particular security permission to be enabled. Any
idea which permission does this need in the Tomcats catalina.policy file?

Following is the StackTrace -

java.lang.NoClassDefFoundError: Could not initialize class
org.apache.logging.log4j.core.lookup.JmxRuntimeInputArgumentsLookup

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

(Continue reading)

Daniel Marcotte | 5 May 22:24 2015
Picon

Log4j2 : How to configure multiple Appender with same type in Yaml configuration

Hi!

I don’t know if any of you has the answer to my question :
http://stackoverflow.com/q/30062099/1568940

At first glance I think there’s a bug.

Thank you very much

Daniel Marcotte

Gmane