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
Mike Calmus | 29 Apr 21:53 2015

adding log4j 2.x support to a library

We have some existing code that is used as a library by other projects.
This code uses log4j 1.2. We would like to convert it to use log4j 2.x but
not remove support for 1.2 so that projects that have not yet migrated can
still see logging. Any thoughts on how this might be accomplished?

Thanks.
Veselin M | 19 Apr 11:27 2015

Memory leak by not disposing loggers

Hello all, 

I have a memory leak problem with Log4j2. I’m using SLF4J to get loggers for my objects. Unfortunately
when they get garbage collected the logger remains cached in LoggerContext.loggers in the log4j
framework. Is there any way to prevent the caching or to remove the logger? 

Regards 
Veselin
Ponder Muse | 10 Apr 14:35 2015

log4j2 web lookup questions

Hello,

We have Spring 4 based WAR deployments running on Tomcat 7.0.5x containers
which have just had their log4j2.xml configurations updated to do a
${web:contextPath} lookup in order to use a deployment’s context path as
part of the rolling file’s filename.

We have been able to get log4j2’s web lookups to work but, only after
making two changes in our deployment’s configurations. I list these below:

1) We had to remove org.apache.logging.log4j:log4j-slf4j-impl:2.2 jar from
the deployment’s classpath (but we don't know why this is necessary? We
need this facade for when using 3rd party jars that don't natively work
with log4j2, right!?).

2) We had to include a <display-name>name_here</display-name> entry in the
deployment's web.xml (I read in a Stackoverflow post that the display name
should not be enforced and that it was a bug – not sure if it’s a Tomcat
bug or log4j2 bug however).

Could somebody comment on points 1) and 2)? Particularly point 1) as we
really need to have log4j-slf4j capability in our deployments.

Thanks for any comments/suggestions to these two points.

PM.
Mikael Ståldal | 7 Apr 17:38 2015

Log4j 2 plugin in Scala

Is it possible to write a Log4j 2 plugin in Scala?

Using Log4j 2.2.

--

-- 
[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.
coderbrat | 6 Apr 20:58 2015
Picon

log4j log file not created

This is my log4j.xml and I want to create a log file wws.log either in a
folder where folder path = AE_HOME/logs/ where AE_HOME = "C:/AE/" and
AE_HOME is set as a system variable by another program already.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM &quot;log4j.dtd&quot;>
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
        debug="false">
        <appender name="FILE" class="org.apache.log4j.RollingFileAppender">

            

            

            
            <layout class="org.apache.log4j.PatternLayout">

            </layout>
        </appender>

I also tried using env:AE_HOME in the file path but still I dont find the
log file getting generated anywhere. I tried hard coding the path too, but
still no log file. I have permission to write in the C drive so that's not
an issue.

This is where the logger is being setup in the ServletInit class:

    //initialize log4j
    String log4jConfig =
event.getServletContext().getInitParameter("log4j-config"); // log4jConfig =
(Continue reading)

arjun Sirupa (asirupa | 4 Apr 06:58 2015
Picon

suppress beanutils logging for certain fields


Hello,

In our application, we are using log4j 1.2.17. We use Struts which internally uses beanutils for Login
bean. If log level is set to DEBUG for “org.apache.commons.beanutils” category in log4j.xml, it
prints password in clear text.

In below example, user’s username is “admin” and password is “password”.

DEBUG  [admin-http-pool1][] org.apache.commons.beanutils.ConvertUtils
-::25E5ED4A07F594C9CBDC2C7915D657D2:::- Convert string 'admin' to class 'java.lang.String'

DEBUG  [admin-http-pool1][] org.apache.commons.beanutils.ConvertUtils
-::25E5ED4A07F594C9CBDC2C7915D657D2:::- Convert string ‘password' to class 'java.lang.String'

The security team at our company reported this as a security vulnerability and want us to fix immediately.
Any ideas on how to suppress logging for particular fields ? Or Is there any other alternative ?

Please share your input.

Thanks,
Arjun.


Gmane