Discussion:
[jira] [Created] (LOG4J2-870) log4j2 with servlet 3.0 container in WAS8.5 not working
Sudhakar (JIRA)
2014-10-06 16:57:34 UTC
Permalink
Sudhakar created LOG4J2-870:
-------------------------------

Summary: log4j2 with servlet 3.0 container in WAS8.5 not working
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker


Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working

1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath

if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-06 17:02:46 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sudhakar updated LOG4J2-870:
----------------------------
Attachment: log4j1.png
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-06 17:03:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sudhakar updated LOG4J2-870:
----------------------------
Attachment: log4j4.png
log4j3.png
log4j2.png
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-07 16:26:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sudhakar closed LOG4J2-870.
---------------------------
Resolution: Fixed

Problem was resolved. The issues is with log4j2.xml file. Rootlevel was as trace and once I changed it to debug, I can see the logs in the console and in log files. Jeez....took 6 days to figureout.
<Root level="debug" additivity="false">
<appender-ref ref="trace-log" level="debug"/>
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="debug"/>

</Root>
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-07 16:51:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162101#comment-14162101 ]

Remko Popma commented on LOG4J2-870:
------------------------------------

Glad to hear it is resolved, but to be honest I'm still unclear on what exactly the problem was. What was the original log4j2.xml config that caused the issue?
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-07 19:43:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162391#comment-14162391 ]

Sudhakar commented on LOG4J2-870:
---------------------------------

When I have <Root level="trace" additivity="false"> root leve las trace, it did not write the log in neilther log files nor in console. That made me think of IBm class loder, IBM lof4J may be overwrting log4j2 etc. After changing root level from trace to debug, I can see everyting is working.
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-07 22:08:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162655#comment-14162655 ]

Remko Popma commented on LOG4J2-870:
------------------------------------

Can you attach (or paste the contents of) the full log4j config that was giving you trouble (so before you fixed it)?

I think it's strange that a more restrictive level on the root logger gives more output...
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-07 22:42:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14162713#comment-14162713 ]

Remko Popma commented on LOG4J2-870:
------------------------------------

(I'm trying to understand to double-check this is not a log4j bug, and also so that I'll be able to help other users who run into the same problem.)
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-08 12:54:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163448#comment-14163448 ]

Sudhakar commented on LOG4J2-870:
---------------------------------

Sure. Please see below xml that did not work or it could be my lack of understanding. I have "logger.debug("In Test Servlet");" in test serevlet. Because I have root level as info and in the servlet I am trying to log debug, I did not see it in console and log files ? Not sure but as soon as i chnaged rtoot level as debug, i can see trace log file and in console.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="trace">
<Properties>
<Property name="log-path">C:/logs/eAdmin</Property>
</Properties>
<Appenders>
<Console name="console-log" target="SYSTEM_OUT">
<PatternLayout pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"/>
</Console>

<RollingFile name="trace-log" fileName="${log-path}/eAdmin-trace.log"
filePattern="${log-path}/eAdmin-trace-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
<RollingFile name="error-log" fileName="${log-path}/eAdmin-error.log"
filePattern="${log-path}/eAdmin-error-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>

<Root level="info" additivity="false">
<appender-ref ref="trace-log" level="debug"/>
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="debug"/>

</Root>
</Loggers>
</Configuration>
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-08 13:47:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma reopened LOG4J2-870:
--------------------------------
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-08 13:48:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163448#comment-14163448 ]

Remko Popma edited comment on LOG4J2-870 at 10/8/14 1:48 PM:
-------------------------------------------------------------

Sure. Please see below xml that did not work or it could be my lack of understanding. I have "logger.debug("In Test Servlet");" in test serevlet. Because I have root level as info and in the servlet I am trying to log debug, I did not see it in console and log files ? Not sure but as soon as i chnaged rtoot level as debug, i can see trace log file and in console.

{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="trace">
<Properties>
<Property name="log-path">C:/logs/eAdmin</Property>
</Properties>
<Appenders>
<Console name="console-log" target="SYSTEM_OUT">
<PatternLayout pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"/>
</Console>

<RollingFile name="trace-log" fileName="${log-path}/eAdmin-trace.log"
filePattern="${log-path}/eAdmin-trace-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
<RollingFile name="error-log" fileName="${log-path}/eAdmin-error.log"
filePattern="${log-path}/eAdmin-error-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>

<Root level="info" additivity="false">
<appender-ref ref="trace-log" level="debug"/>
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="debug"/>

</Root>
</Loggers>
</Configuration>
{code}



was (Author: sudhakartv):
Sure. Please see below xml that did not work or it could be my lack of understanding. I have "logger.debug("In Test Servlet");" in test serevlet. Because I have root level as info and in the servlet I am trying to log debug, I did not see it in console and log files ? Not sure but as soon as i chnaged rtoot level as debug, i can see trace log file and in console.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="trace">
<Properties>
<Property name="log-path">C:/logs/eAdmin</Property>
</Properties>
<Appenders>
<Console name="console-log" target="SYSTEM_OUT">
<PatternLayout pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"/>
</Console>

<RollingFile name="trace-log" fileName="${log-path}/eAdmin-trace.log"
filePattern="${log-path}/eAdmin-trace-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
<RollingFile name="error-log" fileName="${log-path}/eAdmin-error.log"
filePattern="${log-path}/eAdmin-error-%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
</RollingFile>
</Appenders>
<Loggers>

<Root level="info" additivity="false">
<appender-ref ref="trace-log" level="debug"/>
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="debug"/>

</Root>
</Loggers>
</Configuration>
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Remko Popma (JIRA)
2014-10-08 13:53:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Remko Popma closed LOG4J2-870.
------------------------------
Resolution: Not a Problem

Thanks for providing your configuration. Now I understand what happened.

Your application logs at DEBUG level, but the root logger filtered out all events that were not at least INFO, so no events were sent to the appenders.

After modifying {{<root level="info">}} to {{<root level="debug">}}, the events that your application logs at DEBUG level are now sent to the appenders.

(Note that if your application logs anything at TRACE level it will not appear in the logs. For that you need to change both the root level filtering and the filter level on the appender-ref(s).)
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-08 22:06:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14164265#comment-14164265 ]

Sudhakar commented on LOG4J2-870:
---------------------------------

Thanks! I would like to ask you another question. What is asynchronous logging and where do we use? What is the advantage of it? If you can explain me a sample scenario, that would be great. I know you are very busy person; this question may be very low level for you so not an urgent :) Thanks!. It is working what I need it for now, but would like to learn more.
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Matt Sicker (JIRA)
2014-10-08 23:12:34 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14164358#comment-14164358 ]

Matt Sicker commented on LOG4J2-870:
------------------------------------

Take a look at this: http://logging.apache.org/log4j/2.x/manual/async.html
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-09 20:22:35 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165678#comment-14165678 ]

Sudhakar commented on LOG4J2-870:
---------------------------------

Thank you! I have read and have some questions.
1.In Mixing Synchronous and Asynchronous Loggers example
<!-- pattern layout actually uses location, so we need to include it -->
<AsyncLogger name="com.foo.Bar" level="trace" includeLocation="true">
<AppenderRef ref="RandomAccessFile"/>
</AsyncLogger>
<Root level="info" includeLocation="true">
<AppenderRef ref="RandomAccessFile"/>
</Root>

Both Async appender and Root level appenders are using same RandomAccessFile but have two diffrent log levels. For Asunc level ="trace" and Root level="info". I am little confused how this will work. Could you please explain me ? With above example I have changed my log file as below (Not knowing how it works :))

<AsyncLogger name="com.mycompany.eadmin" level="trace" includeLocation="true">
<AppenderRef ref="trace-log"/>
</AsyncLogger>

<Root level="debug" additivity="false" includeLocation="true">
<appender-ref ref="trace-log" level="debug"/>
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="debug"/>
</Root>
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Sudhakar (JIRA)
2014-10-09 20:48:33 UTC
Permalink
[ https://issues.apache.org/jira/browse/LOG4J2-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165721#comment-14165721 ]

Sudhakar commented on LOG4J2-870:
---------------------------------

I have added disruptor and below apender worked fine. I can see all logs in console and trace-log file and erors only in error-log file. My question is still how I see the diffrence in using AsyncLogger ? Thanks!

<AsyncLogger name="com.abc.eadmin" level="trace" includeLocation="true">
<AppenderRef ref="trace-log"/>
</AsyncLogger>

<Root level="debug" additivity="false" includeLocation="true">
<appender-ref ref="error-log" level="error"/>
<appender-ref ref="console-log" level="trace"/>
</Root>
Post by Sudhakar (JIRA)
log4j2 with servlet 3.0 container in WAS8.5 not working
-------------------------------------------------------
Key: LOG4J2-870
URL: https://issues.apache.org/jira/browse/LOG4J2-870
Project: Log4j 2
Issue Type: Question
Components: log4j 1.2 emulation
Environment: Windows 7, WAS8.5, Java1.6
Reporter: Sudhakar
Priority: Blocker
Attachments: log4j1.png, log4j2.png, log4j3.png, log4j4.png
Trying to setup new J2EE project on WAS8.5 using latest Log4J2 jar files. When I run a test servlet, logfiles are not geting created and writing the log.
http://stackoverflow.com/questions/26164572/log4j2-with-servlet-3-0-container-in-was8-5-not-working
1. Log4J2.xml is placed under WEB-INF/classes
2.Log4j-api-2.0.2.jar, log4j-core-2.0.2,log4j-web-2.0.2 inluded in the classpath
if I run DemoLog4J class with main method, I am able to see console and logfiles are written without system property for log4J2.xml location.
Please help. Thanks!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Loading...