Re: ExecutorService.shutdown

2017-01-10 Thread Apache

> On Jan 10, 2017, at 2:09 PM, Mikael Ståldal  wrote:
> 
> It seems like ExecutorService.shutdown invokes executorService.shutdown() 
> twice If timeout is 0. Is this correct?

A) Do you mean ExecutorServices? I don’t see any code that calls shutdown() 
twice. I do see code that calls shutdown() followed by shutdownNow().
B) Until you mentioned this I hadn’t even noticed that ExecutorServices were 
added to the LoggerContext. I have no idea why that was done.  The whole point 
of the ConfigurationScheduler is to handle running asynchronous tasks from one 
place. Those extra ExecutorServices really should be removed.

Ralph



-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



Re: Github integration set up: logging--log4j-boot.git

2017-01-10 Thread Matt Sicker
Yeah, that's a duplicate anyhow. The correctly named one is where I've
added a few files.

On 10 January 2017 at 20:30, Gary Gregory  wrote:

> That repo name is not right :-(
>
> G
>
> -- Forwarded message --
> From: 
> Date: Tue, Jan 10, 2017 at 6:30 PM
> Subject: Github integration set up: logging--log4j-boot.git
> To: infrastruct...@apache.org, priv...@logging.apache.org
>
>
> New repository logging--log4j-boot.git has now had GitHub integration
> enabled!
>
> With regards,
> Apache Infrastructure.
>
>
>
> --
> E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> Java Persistence with Hibernate, Second Edition
> 
>
> 
> JUnit in Action, Second Edition
> 
>
> 
> Spring Batch in Action
> 
> 
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker 


Fwd: Github integration set up: logging--log4j-boot.git

2017-01-10 Thread Gary Gregory
That repo name is not right :-(

G

-- Forwarded message --
From: 
Date: Tue, Jan 10, 2017 at 6:30 PM
Subject: Github integration set up: logging--log4j-boot.git
To: infrastruct...@apache.org, priv...@logging.apache.org


New repository logging--log4j-boot.git has now had GitHub integration
enabled!

With regards,
Apache Infrastructure.



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition



JUnit in Action, Second Edition



Spring Batch in Action


Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816578#comment-15816578
 ] 

Gary Gregory commented on LOG4J2-1748:
--

Yep, IIRC, that is why I did it that way.

> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncAppenders,name=*'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncLoggerRingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=Loggers,name=*,subtype=RingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Stopping 
> XmlConfiguration[location=C:\Users\danidemi\workspace\bug-log4j2-hanging-up-before-shutdown\target\classes\log4j2.xml]...
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE XmlConfiguration notified 3 
> 

[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread Remko Popma (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816488#comment-15816488
 ] 

Remko Popma commented on LOG4J2-1748:
-

I believe (I could be wrong) that the non-daemon thread was introduced to 
prevent the compress action from being interrupted if the application ended 
immediately after a rollover. 

True, if forcefully killed this may still happen, but it makes sense to do 
compression in a non-daemon thread. 

> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncAppenders,name=*'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncLoggerRingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=Loggers,name=*,subtype=RingBuffer'
> 

Jenkins build is back to stable : Log4j 2.x #2594

2017-01-10 Thread Apache Jenkins Server
See 


-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1640) RollingFileAppender with CronTriggeringPolicy broken?

2017-01-10 Thread Ralph Goers (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816297#comment-15816297
 ] 

Ralph Goers commented on LOG4J2-1640:
-

Yes, you would need to re-clone and re-build. If you want the rollover at 
midnight then you can set your clock before starting the test application or 
just let it roll at midnight. Otherwise you can change your pattern to have it 
roll every hour or 2 instead of only at midnight.

> RollingFileAppender with CronTriggeringPolicy broken?
> -
>
> Key: LOG4J2-1640
> URL: https://issues.apache.org/jira/browse/LOG4J2-1640
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.7
> Environment: Mac OS X 10.11.6 running Eclipse Neon 4.6.0 with JDK 
> 1.8.0_74
>Reporter: Chris McGee
>  Labels: CronTriggeringPolicy, RollingFile, RollingFileAppender, 
> newbie
> Fix For: 2.8
>
>
> If this isn't actually a bug, then I apologize for reporting it, but I cannot 
> figure out how it could be anything else currently. Full disclosure: I am 
> still a newbie.
> I've been using the log4j 2.6.x series for a while, but noticed that the 
> CronTriggeringPolicy when used with RollingFileAppender causes that infinite 
> rollover bug. I noted that this bug was to be fixed in 2.7, so I downloaded 
> that the day it was released and replaced the 2.6 version with it. Now, 
> however, without changing anything else in my code nor in my log4j2.xml file, 
> I am getting exceptions regarding them.
> Here's the interesting bit: Since I was trying to see if the rollover would 
> occur at midnight, I manually changed my computer's clock to just  a minute 
> before, logged some info, let it roll to past midnight, and let it log some 
> more info. All of that info got logged into the main file; nothing rolled 
> over. Here's the stacktrace from that execution:
> {noformat}
> 2016-10-10 09:40:47,521 main DEBUG Initializing configuration 
> XmlConfiguration[location=/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml]
> 2016-10-10 09:40:47,526 main DEBUG Installed script engines
> 2016-10-10 09:40:47,955 main DEBUG Oracle Nashorn Version: 1.8.0_74, 
> Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: 
> {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
> 2016-10-10 09:40:48,307 main DEBUG AppleScriptEngine Version: 1.1, Language: 
> AppleScript, Threading: Not Thread Safe, Compile: false, Names: 
> {AppleScriptEngine, AppleScript, OSA}
> 2016-10-10 09:40:48,308 main DEBUG PluginManager 'Core' found 107 plugins
> 2016-10-10 09:40:48,308 main DEBUG PluginManager 'Level' found 0 plugins
> 2016-10-10 09:40:48,312 main DEBUG 2 starting Log4j2 ConfigurationScheduler 
> threads
> 2016-10-10 09:40:48,314 main DEBUG Building Plugin[name=property, 
> class=org.apache.logging.log4j.core.config.Property].
> 2016-10-10 09:40:48,323 main TRACE TypeConverterRegistry initializing.
> 2016-10-10 09:40:48,324 main DEBUG PluginManager 'TypeConverter' found 23 
> plugins
> 2016-10-10 09:40:48,330 main DEBUG createProperty(name="filename", 
> value="logs/artdept.log")
> 2016-10-10 09:40:48,330 main DEBUG Building Plugin[name=property, 
> class=org.apache.logging.log4j.core.config.Property].
> 2016-10-10 09:40:48,331 main DEBUG createProperty(name="baseDir", 
> value="/Volumes/ArtDept/ArtDept/Scripts/sky-artdept/logs")
> 2016-10-10 09:40:48,331 main DEBUG Building Plugin[name=properties, 
> class=org.apache.logging.log4j.core.config.PropertiesPlugin].
> 2016-10-10 09:40:48,334 main DEBUG 
> configureSubstitutor(={filename=logs/artdept.log, 
> baseDir=/Volumes/ArtDept/ArtDept/Scripts/sky-artdept/logs}, 
> Configuration(/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml))
> 2016-10-10 09:40:48,335 main DEBUG PluginManager 'Lookup' found 13 plugins
> 2016-10-10 09:40:48,335 main DEBUG Building Plugin[name=layout, 
> class=org.apache.logging.log4j.core.layout.PatternLayout].
> 2016-10-10 09:40:48,341 main DEBUG 
> PatternLayout$Builder(pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - 
> %msg%n", PatternSelector=null, 
> Configuration(/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml),
>  Replace=null, charset="null", alwaysWriteExceptions="null", 
> noConsoleNoAnsi="null", header="null", footer="null")
> 2016-10-10 09:40:48,341 main DEBUG PluginManager 'Converter' found 41 plugins
> 2016-10-10 09:40:48,342 main DEBUG Building Plugin[name=appender, 
> class=org.apache.logging.log4j.core.appender.ConsoleAppender].
> 2016-10-10 09:40:48,347 main DEBUG 
> ConsoleAppender$Builder(target="SYSTEM_OUT", follow="null", direct="null", 
> bufferedIo="null", bufferSize="null", immediateFlush="null", 
> ignoreExceptions="null", PatternLayout(%d{HH:mm:ss.SSS} [%t] %-5level 
> 

[jira] [Commented] (LOG4J2-1640) RollingFileAppender with CronTriggeringPolicy broken?

2017-01-10 Thread Chris McGee (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816237#comment-15816237
 ] 

Chris McGee commented on LOG4J2-1640:
-

Wow, a lot of new info to take in. I don't fully understand some of it, but it 
sounds like you've made some changes that should correct the issues I've been 
having. At this point, am I to assume that I need to re-clone and re-build your 
repo, then try running it through my program again to see how it goes? (Except 
this time, let it run overnight naturally rather than forcing a rollover with a 
system clock change.)

> RollingFileAppender with CronTriggeringPolicy broken?
> -
>
> Key: LOG4J2-1640
> URL: https://issues.apache.org/jira/browse/LOG4J2-1640
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.7
> Environment: Mac OS X 10.11.6 running Eclipse Neon 4.6.0 with JDK 
> 1.8.0_74
>Reporter: Chris McGee
>  Labels: CronTriggeringPolicy, RollingFile, RollingFileAppender, 
> newbie
> Fix For: 2.8
>
>
> If this isn't actually a bug, then I apologize for reporting it, but I cannot 
> figure out how it could be anything else currently. Full disclosure: I am 
> still a newbie.
> I've been using the log4j 2.6.x series for a while, but noticed that the 
> CronTriggeringPolicy when used with RollingFileAppender causes that infinite 
> rollover bug. I noted that this bug was to be fixed in 2.7, so I downloaded 
> that the day it was released and replaced the 2.6 version with it. Now, 
> however, without changing anything else in my code nor in my log4j2.xml file, 
> I am getting exceptions regarding them.
> Here's the interesting bit: Since I was trying to see if the rollover would 
> occur at midnight, I manually changed my computer's clock to just  a minute 
> before, logged some info, let it roll to past midnight, and let it log some 
> more info. All of that info got logged into the main file; nothing rolled 
> over. Here's the stacktrace from that execution:
> {noformat}
> 2016-10-10 09:40:47,521 main DEBUG Initializing configuration 
> XmlConfiguration[location=/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml]
> 2016-10-10 09:40:47,526 main DEBUG Installed script engines
> 2016-10-10 09:40:47,955 main DEBUG Oracle Nashorn Version: 1.8.0_74, 
> Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: 
> {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
> 2016-10-10 09:40:48,307 main DEBUG AppleScriptEngine Version: 1.1, Language: 
> AppleScript, Threading: Not Thread Safe, Compile: false, Names: 
> {AppleScriptEngine, AppleScript, OSA}
> 2016-10-10 09:40:48,308 main DEBUG PluginManager 'Core' found 107 plugins
> 2016-10-10 09:40:48,308 main DEBUG PluginManager 'Level' found 0 plugins
> 2016-10-10 09:40:48,312 main DEBUG 2 starting Log4j2 ConfigurationScheduler 
> threads
> 2016-10-10 09:40:48,314 main DEBUG Building Plugin[name=property, 
> class=org.apache.logging.log4j.core.config.Property].
> 2016-10-10 09:40:48,323 main TRACE TypeConverterRegistry initializing.
> 2016-10-10 09:40:48,324 main DEBUG PluginManager 'TypeConverter' found 23 
> plugins
> 2016-10-10 09:40:48,330 main DEBUG createProperty(name="filename", 
> value="logs/artdept.log")
> 2016-10-10 09:40:48,330 main DEBUG Building Plugin[name=property, 
> class=org.apache.logging.log4j.core.config.Property].
> 2016-10-10 09:40:48,331 main DEBUG createProperty(name="baseDir", 
> value="/Volumes/ArtDept/ArtDept/Scripts/sky-artdept/logs")
> 2016-10-10 09:40:48,331 main DEBUG Building Plugin[name=properties, 
> class=org.apache.logging.log4j.core.config.PropertiesPlugin].
> 2016-10-10 09:40:48,334 main DEBUG 
> configureSubstitutor(={filename=logs/artdept.log, 
> baseDir=/Volumes/ArtDept/ArtDept/Scripts/sky-artdept/logs}, 
> Configuration(/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml))
> 2016-10-10 09:40:48,335 main DEBUG PluginManager 'Lookup' found 13 plugins
> 2016-10-10 09:40:48,335 main DEBUG Building Plugin[name=layout, 
> class=org.apache.logging.log4j.core.layout.PatternLayout].
> 2016-10-10 09:40:48,341 main DEBUG 
> PatternLayout$Builder(pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - 
> %msg%n", PatternSelector=null, 
> Configuration(/Users/apache/Dropbox/eclipse/workspace/ArtDept/bin/log4j2.xml),
>  Replace=null, charset="null", alwaysWriteExceptions="null", 
> noConsoleNoAnsi="null", header="null", footer="null")
> 2016-10-10 09:40:48,341 main DEBUG PluginManager 'Converter' found 41 plugins
> 2016-10-10 09:40:48,342 main DEBUG Building Plugin[name=appender, 
> class=org.apache.logging.log4j.core.appender.ConsoleAppender].
> 2016-10-10 09:40:48,347 main DEBUG 
> ConsoleAppender$Builder(target="SYSTEM_OUT", follow="null", direct="null", 
> 

[jira] [Commented] (LOG4J2-1780) LoggerContext does not shut down old executor services when creating new ones during reconfiguration

2017-01-10 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816238#comment-15816238
 ] 

Gary Gregory commented on LOG4J2-1780:
--

What I think we need to consider here is if reconfiguring a {{LoggerContext}} 
means that we should:

- stop it
- reconfigure it
- start it

The {{org.apache.logging.log4j.core.LoggerContext.stop(long, TimeUnit)}} method 
stops all executors.

Right now, reconfiguring does not do that. 

Callers of {{setConfiguration}} like the {{reconfigure}} methods could stop (if 
needed) and start itself.

Needs more thought...

> LoggerContext does not shut down old executor services when creating new ones 
> during reconfiguration
> 
>
> Key: LOG4J2-1780
> URL: https://issues.apache.org/jira/browse/LOG4J2-1780
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.7
>Reporter: Mikael Ståldal
>
> LoggerContext does not shut down old executor services when creating new ones 
> during reconfiguration in {{LoggerContext.setConfiguration}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1780) LoggerContext does not shut down old executor services when creating new ones during reconfiguration

2017-01-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816212#comment-15816212
 ] 

Mikael Ståldal commented on LOG4J2-1780:


Ping [~garydgregory]

> LoggerContext does not shut down old executor services when creating new ones 
> during reconfiguration
> 
>
> Key: LOG4J2-1780
> URL: https://issues.apache.org/jira/browse/LOG4J2-1780
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 2.7
>Reporter: Mikael Ståldal
>
> LoggerContext does not shut down old executor services when creating new ones 
> during reconfiguration in {{LoggerContext.setConfiguration}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816208#comment-15816208
 ] 

Mikael Ståldal commented on LOG4J2-1748:


Created a bug for the failure to shut down old ExecutorServices: 
https://issues.apache.org/jira/browse/LOG4J2-1780

> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncAppenders,name=*'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncLoggerRingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=Loggers,name=*,subtype=RingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Stopping 
> XmlConfiguration[location=C:\Users\danidemi\workspace\bug-log4j2-hanging-up-before-shutdown\target\classes\log4j2.xml]...
>

[jira] [Created] (LOG4J2-1780) LoggerContext does not shut down old executor services when creating new ones during reconfiguration

2017-01-10 Thread JIRA
Mikael Ståldal created LOG4J2-1780:
--

 Summary: LoggerContext does not shut down old executor services 
when creating new ones during reconfiguration
 Key: LOG4J2-1780
 URL: https://issues.apache.org/jira/browse/LOG4J2-1780
 Project: Log4j 2
  Issue Type: Bug
  Components: Core
Affects Versions: 2.7
Reporter: Mikael Ståldal


LoggerContext does not shut down old executor services when creating new ones 
during reconfiguration in {{LoggerContext.setConfiguration}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



ExecutorService.shutdown

2017-01-10 Thread Mikael Ståldal
It seems like ExecutorService.shutdown invokes executorService.shutdown()
twice If timeout is 0. Is this correct?


[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15816150#comment-15816150
 ] 

Mikael Ståldal commented on LOG4J2-1748:


I am not sure that it will be dangerous to use a daemon thread since we have a 
shutdown hook. According to 
http://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#addShutdownHook-java.lang.Thread-
 :

{code}
Note that daemon threads will continue to run during the shutdown sequence, as 
will non-daemon threads if shutdown was initiated by invoking the exit method. 
{code}

If there is a risk for partial rollover with daemon threads, that risk exist 
for non-daemon threads as well if the application exits with 
{{System.exit(int)}} (which is a quite common thing to do I guess).

I suggest that we remove the non-daemon executor pool and only have a daemon 
one. Then Remko's fix can be reverted.


> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 

[jira] [Closed] (LOG4J2-1762) Add Builder to GelfLayout

2017-01-10 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mikael Ståldal closed LOG4J2-1762.
--

> Add Builder to GelfLayout
> -
>
> Key: LOG4J2-1762
> URL: https://issues.apache.org/jira/browse/LOG4J2-1762
> Project: Log4j 2
>  Issue Type: New Feature
>  Components: Layouts
>Affects Versions: 2.7
>Reporter: Mikael Ståldal
>Assignee: Mikael Ståldal
> Fix For: 2.8
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



Fwd: logging-log4j2 git commit: LOG4J2-1243 - Allow default value in property to be a Lookup.

2017-01-10 Thread Gary Gregory
-- Forwarded message --
From: 
Date: Tue, Jan 10, 2017 at 7:38 AM
Subject: logging-log4j2 git commit: LOG4J2-1243 - Allow default value in
property to be a Lookup.
To: comm...@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master ba4822b1c -> 0c2c11dbe


LOG4J2-1243 - Allow default value in property to be a Lookup.


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/
commit/0c2c11db
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0c2c11db
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0c2c11db

Branch: refs/heads/master
Commit: 0c2c11dbe5751c1d6f2fe3e9291b09b1d9a99a53
Parents: ba4822b
Author: Ralph Goers 
Authored: Tue Jan 10 08:38:02 2017 -0700
Committer: Ralph Goers 
Committed: Tue Jan 10 08:38:02 2017 -0700

--
 .../core/config/plugins/processor/PluginProcessor.java  |  5 +++--
 .../apache/logging/log4j/core/lookup/Interpolator.java  |  3 ++-
 .../logging/log4j/core/lookup/StrSubstitutor.java   | 10 --
 .../logging/log4j/core/lookup/InterpolatorTest.java |  5 +
 .../logging/log4j/core/lookup/StrSubstitutorTest.java   | 12 
 src/changes/changes.xml |  3 +++
 6 files changed, 33 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/
0c2c11db/log4j-core/src/main/java/org/apache/logging/log4j/
core/config/plugins/processor/PluginProcessor.java
--
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/
config/plugins/processor/PluginProcessor.java b/log4j-core/src/main/java/
org/apache/logging/log4j/core/config/plugins/processor/PluginProcessor.java
index 13a83a6..c7db024 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/
config/plugins/processor/PluginProcessor.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/
config/plugins/processor/PluginProcessor.java
@@ -22,6 +22,7 @@ import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
@@ -127,7 +128,7 @@ public class PluginProcessor extends AbstractProcessor {
 public PluginEntry visitType(final TypeElement e, final Plugin
plugin) {
 Objects.requireNonNull(plugin, "Plugin annotation is null.");
 final PluginEntry entry = new PluginEntry();
-entry.setKey(plugin.name().toLowerCase());
+entry.setKey(plugin.name().toLowerCase(Locale.US));

How about adding a lower-case version of:

org.apache.logging.log4j.util.Strings.toRootUpperCase(String)

?

Gary


Fwd: logging-log4j2 git commit: Fix failing unit test

2017-01-10 Thread Gary Gregory
Our JUnit rule org.apache.logging.log4j.junit.CleanFiles would come in
handy here.

Gary

-- Forwarded message --
From: 
Date: Tue, Jan 10, 2017 at 7:17 AM
Subject: logging-log4j2 git commit: Fix failing unit test
To: comm...@logging.apache.org


Repository: logging-log4j2
Updated Branches:
  refs/heads/master a686a4e8c -> ba4822b1c


Fix failing unit test


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/
commit/ba4822b1
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/ba4822b1
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/ba4822b1

Branch: refs/heads/master
Commit: ba4822b1cfb1d4d74ac7cd4ee9643b98b3e1d78e
Parents: a686a4e
Author: Ralph Goers 
Authored: Tue Jan 10 08:13:05 2017 -0700
Committer: Ralph Goers 
Committed: Tue Jan 10 08:17:43 2017 -0700

--
 .../log4j/core/layout/ConcurrentLoggingWithJsonLayoutTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/
ba4822b1/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/
ConcurrentLoggingWithJsonLayoutTest.java
--
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/
ConcurrentLoggingWithJsonLayoutTest.java b/log4j-core/src/test/java/
org/apache/logging/log4j/core/layout/ConcurrentLoggingWithJsonLayou
tTest.java
index e176eb4..39b6685 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/
ConcurrentLoggingWithJsonLayoutTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/layout/
ConcurrentLoggingWithJsonLayoutTest.java
@@ -28,6 +28,7 @@ import java.util.Set;

 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.junit.LoggerContextRule;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Test;
@@ -46,8 +47,8 @@ public class ConcurrentLoggingWithJsonLayoutTest {
 public static LoggerContextRule context = new
LoggerContextRule("log4j2-json-layout.xml");
 private static final String PATH = "target/test-json-layout.log";

-@Before
-public void before() {
+@AfterClass
+public static void after() {
 new File(PATH).delete();
 }





-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition



JUnit in Action, Second Edition



Spring Batch in Action


Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


[jira] [Closed] (LOG4J2-1769) JsonLayout Throwing Exceptions And Producing Broken Logs

2017-01-10 Thread Brandon Goodin (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brandon Goodin closed LOG4J2-1769.
--

This is indeed fixed in the 2.7.1 SNAPSHOT.

> JsonLayout Throwing Exceptions And Producing Broken Logs
> 
>
> Key: LOG4J2-1769
> URL: https://issues.apache.org/jira/browse/LOG4J2-1769
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Layouts
>Affects Versions: 2.7
> Environment: All Platforms
>Reporter: Brandon Goodin
>Assignee: Remko Popma
> Fix For: 2.8
>
> Attachments: JSONLayoutIssuesTest.java, RequestStatistic.java, 
> log4j2.xml
>
>
> In a multithreaded environment JsonLayout is throwing exceptions and 
> producing fragmented logs. We were able to produce a test that demonstrates 
> this. The following exceptions and broken logging are being seen.
> {code:title=IllegalArgumentException}
> 2017-01-06 16:57:59,173 Thread-98 ERROR An exception occurred processing 
> Appender stdout java.lang.IllegalArgumentException
>   at java.nio.Buffer.position(Buffer.java:244)
>   at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:191)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.writeTo(AbstractLayout.java:179)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:160)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:36)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:447)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:432)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:416)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:402)
>   at 
> org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
>   at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1988)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1960)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:1297)
>   at 
> org.apache.logging.log4j.JSONLayoutIssuesTest$LoggingThread.run(JSONLayoutIssuesTest.java:54)
> {code}
> {code:title=BufferOverflowException}
> 2017-01-06 16:57:59,194 Thread-99 ERROR An exception occurred processing 
> Appender stdout java.nio.BufferOverflowException
>   at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.writeTo(AbstractLayout.java:179)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:160)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:36)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
>   at 
> 

[jira] [Commented] (LOG4J2-1769) JsonLayout Throwing Exceptions And Producing Broken Logs

2017-01-10 Thread Brandon Goodin (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815651#comment-15815651
 ] 

Brandon Goodin commented on LOG4J2-1769:


I tested against 2.7.1-SNAPSHOT on January 10th 
(https://repository.apache.org/content/repositories/snapshots/org/apache/logging/log4j/log4j-api/2.7.1-SNAPSHOT/).
 The tests ran successfully with no exceptions and no fragmented logs.

> JsonLayout Throwing Exceptions And Producing Broken Logs
> 
>
> Key: LOG4J2-1769
> URL: https://issues.apache.org/jira/browse/LOG4J2-1769
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Layouts
>Affects Versions: 2.7
> Environment: All Platforms
>Reporter: Brandon Goodin
>Assignee: Remko Popma
> Fix For: 2.8
>
> Attachments: JSONLayoutIssuesTest.java, RequestStatistic.java, 
> log4j2.xml
>
>
> In a multithreaded environment JsonLayout is throwing exceptions and 
> producing fragmented logs. We were able to produce a test that demonstrates 
> this. The following exceptions and broken logging are being seen.
> {code:title=IllegalArgumentException}
> 2017-01-06 16:57:59,173 Thread-98 ERROR An exception occurred processing 
> Appender stdout java.lang.IllegalArgumentException
>   at java.nio.Buffer.position(Buffer.java:244)
>   at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:191)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.writeTo(AbstractLayout.java:179)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:160)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:36)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:447)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:432)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:416)
>   at 
> org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:402)
>   at 
> org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
>   at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1988)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1960)
>   at 
> org.apache.logging.log4j.spi.AbstractLogger.info(AbstractLogger.java:1297)
>   at 
> org.apache.logging.log4j.JSONLayoutIssuesTest$LoggingThread.run(JSONLayoutIssuesTest.java:54)
> {code}
> {code:title=BufferOverflowException}
> 2017-01-06 16:57:59,194 Thread-99 ERROR An exception occurred processing 
> Appender stdout java.nio.BufferOverflowException
>   at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:189)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.writeTo(AbstractLayout.java:179)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:160)
>   at 
> org.apache.logging.log4j.core.layout.AbstractLayout.encode(AbstractLayout.java:36)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169)
>   at 
> org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
>   at 
> org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
>   at 
> 

Jenkins build is still unstable: Log4j 2.x #2593

2017-01-10 Thread Apache Jenkins Server
See 


-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



Re: [1/2] logging-log4j2 git commit: Fixed concurrency issue affecting all layouts except PatternLayout and GelfLayout, which caused scrambled output and exceptions when logging synchronously from mul

2017-01-10 Thread Remko Popma
Ouch! Thank you!

On Wed, Jan 11, 2017 at 12:16 AM, Apache  wrote:

> Yes, it passes on your Windows machine.
>
> The test was creating the LoggerContext and configuration before the
> @Before code is run. The before method attempts to delete the file. On
> Windows that will fail because the file is open. On unix the file’s
> directory entry will be deleted but the file output stream continues to be
> valid and can be written to but there is no way to access it.
>
> I changed the @Before method to be an @AfterClass method and the problem
> is resolved.
>
> Ralph
>
> On Jan 9, 2017, at 11:37 PM, Remko Popma  wrote:
>
> Sorry. I haven't been able to fix this.
> It passes on my Windows machine.
>
> It has something to do with the path of the log file, I don't understand
> why target/test-json-layout.log can't be found on unix systems...
> I'm thinking to just comment out that part of the test...
>
> Sent from my iPhone
>
> On Jan 10, 2017, at 13:42, Apache  wrote:
>
> ConcurrentLoggingWithJsonLayoutTest is failing for me. I don’t understand
> why.
>
> 2017-01-09 21:41:06,174 main DEBUG Starting LoggerContext[name=org.apache.
> logging.log4j.core.layout.ConcurrentLoggingWithJsonLayoutTest] from
> configuration at log4j2-json-layout.xml
> 2017-01-09 21:41:06,176 main DEBUG Starting LoggerContext[name=org.apache.
> logging.log4j.core.layout.ConcurrentLoggingWithJsonLayoutTest,
> org.apache.logging.log4j.core.LoggerContext@14acaea5] with configuration
> XmlConfiguration[location=/Users/rgoers/projects/apache/
> logging/log4j/log4j2/current/log4j-core/target/test-
> classes/log4j2-json-layout.xml]...
> 2017-01-09 21:41:06,177 main DEBUG Shutdown hook enabled. Registering a
> new one.
> 2017-01-09 21:41:06,187 main DEBUG Initializing configuration
> XmlConfiguration[location=/Users/rgoers/projects/apache/
> logging/log4j/log4j2/current/log4j-core/target/test-
> classes/log4j2-json-layout.xml]
> 2017-01-09 21:41:06,193 main DEBUG Installed script engines
> 2017-01-09 21:41:06,208 main DEBUG Groovy Scripting Engine Version: 2.0,
> Language: Groovy, Threading: MULTITHREADED, Compile: true, Names: {groovy,
> Groovy}
> 2017-01-09 21:41:06,499 main DEBUG Oracle Nashorn Version: 1.8.0_65,
> Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names:
> {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
> 2017-01-09 21:41:06,538 main DEBUG BeanShell Engine Version: 1.0,
> Language: BeanShell, Threading: MULTITHREADED, Compile: true, Names:
> {beanshell, bsh, java}
> 2017-01-09 21:41:06,539 main DEBUG PluginManager 'Core' found 121 plugins
> 2017-01-09 21:41:06,539 main DEBUG PluginManager 'Level' found 1 plugins
> 2017-01-09 21:41:06,543 main DEBUG PluginManager 'Lookup' found 13 plugins
> 2017-01-09 21:41:06,545 main DEBUG Building Plugin[name=layout,
> class=org.apache.logging.log4j.core.layout.JsonLayout].
> 2017-01-09 21:41:06,556 main DEBUG PluginManager 'TypeConverter' found 26
> plugins
> 2017-01-09 21:41:06,575 main DEBUG JsonLayout$Builder(locationInfo="null",
> properties="null", propertiesAsList="null", includeStacktrace="null",
> eventEol="true", compact="true", complete="null", charset="null",
> footerSerializer=null, headerSerializer=null, Configuration(/Users/rgoers/
> projects/apache/logging/log4j/log4j2/current/log4j-core/
> target/test-classes/log4j2-json-layout.xml), footer="null", header="null")
> 2017-01-09 21:41:06,710 main DEBUG PluginManager 'Converter' found 41
> plugins
> 2017-01-09 21:41:06,710 main DEBUG Building Plugin[name=appender,
> class=org.apache.logging.log4j.core.appender.FileAppender].
> 2017-01-09 21:41:06,718 main DEBUG 
> FileAppender$Builder(fileName="target/test-json-layout.log",
> append="false", locking="null", advertise="null", advertiseUri="null",
> createOnDemand="null", bufferedIo="null", bufferSize="null",
> immediateFlush="null", ignoreExceptions="false",
> JsonLayout(org.apache.logging.log4j.core.layout.JsonLayout@37654521),
> name="stdout", Configuration(/Users/rgoers/projects/apache/logging/log4j/
> log4j2/current/log4j-core/target/test-classes/log4j2-json-layout.xml),
> Filter=null)
> 2017-01-09 21:41:06,719 main DEBUG Starting FileManager
> target/test-json-layout.log
> 2017-01-09 21:41:06,720 main DEBUG Building Plugin[name=appenders,
> class=org.apache.logging.log4j.core.config.AppendersPlugin].
> 2017-01-09 21:41:06,721 main DEBUG createAppenders(={stdout})
> 2017-01-09 21:41:06,722 main DEBUG Building Plugin[name=AppenderRef,
> class=org.apache.logging.log4j.core.config.AppenderRef].
> 2017-01-09 21:41:06,725 main DEBUG createAppenderRef(ref="stdout",
> level="null", Filter=null)
> 2017-01-09 21:41:06,726 main DEBUG Building Plugin[name=root,
> class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].
> 2017-01-09 21:41:06,727 main DEBUG createLogger(additivity="null",
> level="INFO", includeLocation="null", ={stdout}, ={},
> 

Re: [1/2] logging-log4j2 git commit: Fixed concurrency issue affecting all layouts except PatternLayout and GelfLayout, which caused scrambled output and exceptions when logging synchronously from mul

2017-01-10 Thread Apache
Yes, it passes on your Windows machine.

The test was creating the LoggerContext and configuration before the @Before 
code is run. The before method attempts to delete the file. On Windows that 
will fail because the file is open. On unix the file’s directory entry will be 
deleted but the file output stream continues to be valid and can be written to 
but there is no way to access it.

I changed the @Before method to be an @AfterClass method and the problem is 
resolved.

Ralph

> On Jan 9, 2017, at 11:37 PM, Remko Popma  wrote:
> 
> Sorry. I haven't been able to fix this. 
> It passes on my Windows machine. 
> 
> It has something to do with the path of the log file, I don't understand why 
> target/test-json-layout.log can't be found on unix systems... 
> I'm thinking to just comment out that part of the test...
> 
> Sent from my iPhone
> 
> On Jan 10, 2017, at 13:42, Apache  > wrote:
> 
>> ConcurrentLoggingWithJsonLayoutTest is failing for me. I don’t understand 
>> why.
>> 
>> 2017-01-09 21:41:06,174 main DEBUG Starting 
>> LoggerContext[name=org.apache.logging.log4j.core.layout.ConcurrentLoggingWithJsonLayoutTest]
>>  from configuration at log4j2-json-layout.xml
>> 2017-01-09 21:41:06,176 main DEBUG Starting 
>> LoggerContext[name=org.apache.logging.log4j.core.layout.ConcurrentLoggingWithJsonLayoutTest,
>>  org.apache.logging.log4j.core.LoggerContext@14acaea5] with configuration 
>> XmlConfiguration[location=/Users/rgoers/projects/apache/logging/log4j/log4j2/current/log4j-core/target/test-classes/log4j2-json-layout.xml]...
>> 2017-01-09 21:41:06,177 main DEBUG Shutdown hook enabled. Registering a new 
>> one.
>> 2017-01-09 21:41:06,187 main DEBUG Initializing configuration 
>> XmlConfiguration[location=/Users/rgoers/projects/apache/logging/log4j/log4j2/current/log4j-core/target/test-classes/log4j2-json-layout.xml]
>> 2017-01-09 21:41:06,193 main DEBUG Installed script engines
>> 2017-01-09 21:41:06,208 main DEBUG Groovy Scripting Engine Version: 2.0, 
>> Language: Groovy, Threading: MULTITHREADED, Compile: true, Names: {groovy, 
>> Groovy}
>> 2017-01-09 21:41:06,499 main DEBUG Oracle Nashorn Version: 1.8.0_65, 
>> Language: ECMAScript, Threading: Not Thread Safe, Compile: true, Names: 
>> {nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript}
>> 2017-01-09 21:41:06,538 main DEBUG BeanShell Engine Version: 1.0, Language: 
>> BeanShell, Threading: MULTITHREADED, Compile: true, Names: {beanshell, bsh, 
>> java}
>> 2017-01-09 21:41:06,539 main DEBUG PluginManager 'Core' found 121 plugins
>> 2017-01-09 21:41:06,539 main DEBUG PluginManager 'Level' found 1 plugins
>> 2017-01-09 21:41:06,543 main DEBUG PluginManager 'Lookup' found 13 plugins
>> 2017-01-09 21:41:06,545 main DEBUG Building Plugin[name=layout, 
>> class=org.apache.logging.log4j.core.layout.JsonLayout].
>> 2017-01-09 21:41:06,556 main DEBUG PluginManager 'TypeConverter' found 26 
>> plugins
>> 2017-01-09 21:41:06,575 main DEBUG JsonLayout$Builder(locationInfo="null", 
>> properties="null", propertiesAsList="null", includeStacktrace="null", 
>> eventEol="true", compact="true", complete="null", charset="null", 
>> footerSerializer=null, headerSerializer=null, 
>> Configuration(/Users/rgoers/projects/apache/logging/log4j/log4j2/current/log4j-core/target/test-classes/log4j2-json-layout.xml),
>>  footer="null", header="null")
>> 2017-01-09 21:41:06,710 main DEBUG PluginManager 'Converter' found 41 plugins
>> 2017-01-09 21:41:06,710 main DEBUG Building Plugin[name=appender, 
>> class=org.apache.logging.log4j.core.appender.FileAppender].
>> 2017-01-09 21:41:06,718 main DEBUG 
>> FileAppender$Builder(fileName="target/test-json-layout.log", append="false", 
>> locking="null", advertise="null", advertiseUri="null", 
>> createOnDemand="null", bufferedIo="null", bufferSize="null", 
>> immediateFlush="null", ignoreExceptions="false", 
>> JsonLayout(org.apache.logging.log4j.core.layout.JsonLayout@37654521), 
>> name="stdout", 
>> Configuration(/Users/rgoers/projects/apache/logging/log4j/log4j2/current/log4j-core/target/test-classes/log4j2-json-layout.xml),
>>  Filter=null)
>> 2017-01-09 21:41:06,719 main DEBUG Starting FileManager 
>> target/test-json-layout.log
>> 2017-01-09 21:41:06,720 main DEBUG Building Plugin[name=appenders, 
>> class=org.apache.logging.log4j.core.config.AppendersPlugin].
>> 2017-01-09 21:41:06,721 main DEBUG createAppenders(={stdout})
>> 2017-01-09 21:41:06,722 main DEBUG Building Plugin[name=AppenderRef, 
>> class=org.apache.logging.log4j.core.config.AppenderRef].
>> 2017-01-09 21:41:06,725 main DEBUG createAppenderRef(ref="stdout", 
>> level="null", Filter=null)
>> 2017-01-09 21:41:06,726 main DEBUG Building Plugin[name=root, 
>> class=org.apache.logging.log4j.core.config.LoggerConfig$RootLogger].
>> 2017-01-09 21:41:06,727 main DEBUG createLogger(additivity="null", 
>> level="INFO", includeLocation="null", ={stdout}, ={}, 

[jira] [Closed] (LOG4J2-1779) AsyncLogger does not lookup properties

2017-01-10 Thread Remko Popma (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma closed LOG4J2-1779.
---

> AsyncLogger does not lookup properties
> --
>
> Key: LOG4J2-1779
> URL: https://issues.apache.org/jira/browse/LOG4J2-1779
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core, Lookups
>Reporter: Remko Popma
>Assignee: Remko Popma
> Fix For: 2.8
>
>
> When copying configuration Properties into the context data map of each log 
> event, property values that start with "${" should be treated as a Lookup and 
> be resolved with {{StrSubstitutor.replace}}.
> AsyncLogger has a bug such that this lookup does not happen and the original 
> value (starting with "${") is put in the contxt data map of the log event.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Resolved] (LOG4J2-1779) AsyncLogger does not lookup properties

2017-01-10 Thread Remko Popma (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Remko Popma resolved LOG4J2-1779.
-
Resolution: Fixed

Fixed in commit a686a4e.

> AsyncLogger does not lookup properties
> --
>
> Key: LOG4J2-1779
> URL: https://issues.apache.org/jira/browse/LOG4J2-1779
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Core, Lookups
>Reporter: Remko Popma
>Assignee: Remko Popma
> Fix For: 2.8
>
>
> When copying configuration Properties into the context data map of each log 
> event, property values that start with "${" should be treated as a Lookup and 
> be resolved with {{StrSubstitutor.replace}}.
> AsyncLogger has a bug such that this lookup does not happen and the original 
> value (starting with "${") is put in the contxt data map of the log event.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Created] (LOG4J2-1779) AsyncLogger does not lookup properties

2017-01-10 Thread Remko Popma (JIRA)
Remko Popma created LOG4J2-1779:
---

 Summary: AsyncLogger does not lookup properties
 Key: LOG4J2-1779
 URL: https://issues.apache.org/jira/browse/LOG4J2-1779
 Project: Log4j 2
  Issue Type: Bug
  Components: Core, Lookups
Reporter: Remko Popma
Assignee: Remko Popma
 Fix For: 2.8


When copying configuration Properties into the context data map of each log 
event, property values that start with "${" should be treated as a Lookup and 
be resolved with {{StrSubstitutor.replace}}.

AsyncLogger has a bug such that this lookup does not happen and the original 
value (starting with "${") is put in the contxt data map of the log event.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1724) Using variables in GelfLayout's additional fields at runtime

2017-01-10 Thread Alexander K. (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15815008#comment-15815008
 ] 

Alexander K. commented on LOG4J2-1724:
--

It works as expected. Thanks.

> Using variables in GelfLayout's additional fields at runtime
> 
>
> Key: LOG4J2-1724
> URL: https://issues.apache.org/jira/browse/LOG4J2-1724
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Layouts
>Affects Versions: 2.6.2, 2.7
>Reporter: Alexander K.
>Assignee: Mikael Ståldal
> Fix For: 2.8
>
> Attachments: patchfile.txt, patchfile.txt
>
>
> Hello,
> I would like to suggest the following improvements for GelfLayout:
> 1. Using variables in additional fields at runtime. For example resolving 
> "value": "$$\{ctx:key\}" at runtime as it is done in other places. Thus, 
> custom lookups will be available as well.
> 2. Having an indicator includeThreadContext to control whether the contents 
> of the ThreadContext should be included. Sometimes it is usable to include 
> only some of its values and then it will be available using the first 
> suggested improvement by specific variable resolution.
> 3. Resolving HOST attribute in case it is not provided by using for example 
> InetAddress.getLocalHost().getHostName().
> Regards,
> Alexander



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Closed] (LOG4J2-1724) Using variables in GelfLayout's additional fields at runtime

2017-01-10 Thread Alexander K. (JIRA)

 [ 
https://issues.apache.org/jira/browse/LOG4J2-1724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander K. closed LOG4J2-1724.


> Using variables in GelfLayout's additional fields at runtime
> 
>
> Key: LOG4J2-1724
> URL: https://issues.apache.org/jira/browse/LOG4J2-1724
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Layouts
>Affects Versions: 2.6.2, 2.7
>Reporter: Alexander K.
>Assignee: Mikael Ståldal
> Fix For: 2.8
>
> Attachments: patchfile.txt, patchfile.txt
>
>
> Hello,
> I would like to suggest the following improvements for GelfLayout:
> 1. Using variables in additional fields at runtime. For example resolving 
> "value": "$$\{ctx:key\}" at runtime as it is done in other places. Thus, 
> custom lookups will be available as well.
> 2. Having an indicator includeThreadContext to control whether the contents 
> of the ThreadContext should be included. Sometimes it is usable to include 
> only some of its values and then it will be available using the first 
> suggested improvement by specific variable resolution.
> 3. Resolving HOST attribute in case it is not provided by using for example 
> InetAddress.getLocalHost().getHostName().
> Regards,
> Alexander



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15814716#comment-15814716
 ] 

Mikael Ståldal commented on LOG4J2-1748:


After looking more closely at this, I think it actually make sense to have this 
separate. It is actually idle thread timeout, not shutdown timeout. It just 
happen to delay shutdown in some cases (when the app doesn't to 
{{System.exit(int)}}).

> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncAppenders,name=*'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncLoggerRingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=Loggers,name=*,subtype=RingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Stopping 

[jira] [Commented] (LOG4J2-1748) RollingFile appender prevents a stand alone application to terminate for as long as 60 sec

2017-01-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15814711#comment-15814711
 ] 

Mikael Ståldal commented on LOG4J2-1748:


A simple workaround is to add System.exit(0) at the end of the main method.

> RollingFile appender prevents a stand alone application to terminate for as 
> long as 60 sec
> --
>
> Key: LOG4J2-1748
> URL: https://issues.apache.org/jira/browse/LOG4J2-1748
> Project: Log4j 2
>  Issue Type: Bug
>  Components: Appenders
>Affects Versions: 2.7
> Environment: Java8, Windows
>Reporter: Daniele Demichelis
>Assignee: Remko Popma
>  Labels: RollingFile, bug
> Fix For: 2.8
>
>
> This code reproduces what I think is a bug of Log4j2.
> It's a simple loop that logs 2000 messages with two appenders:
> a console appender and a rolling file appender that rolls the file
> every 5Kb. This limit is intentionally low to reproduce what I think is a bug.
> Here's the code.
> {code:java}
> package bug;
> 
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> public class Example {
> 
> private static final Logger logger = 
> LogManager.getLogger(Example.class);
> 
> public static void main(String[] args) throws InterruptedException {
> for(int i = 0; i<2000; i++){
> logger.info("This is log message #{}.", i);
> Thread.sleep(0);
> }
> }
> 
> }
> {code}
> Here's the `log4j2.xml` configuration file.
> {code:xml}
> 
> 
> 
> 
> 
> 
>   fileName="target/log4j2/roll-by-size/app.log"
>  
> filePattern="target/log4j2/roll-by-size/app.%i.log.gz"
>  ignoreExceptions="false"
>  append="false">
> 
> %d{-MM-dd HH:mm:ss} %p %m%n
> 
> 
> 
>  size="5 KB"/>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> {code}
> What is strange is that when the application is launched you will see this 
> logs in the console.
> {code}
> 2016-12-22 22:12:36 INFO This is log message #1993.
> 2016-12-22 22:12:36 INFO This is log message #1994.
> 2016-12-22 22:12:36 INFO This is log message #1995.
> 2016-12-22 22:12:36 INFO This is log message #1996.
> 2016-12-22 22:12:36 INFO This is log message #1997.
> 2016-12-22 22:12:36 INFO This is log message #1998.
> 2016-12-22 22:12:36 INFO This is log message #1999.
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]
> 2016-12-22 22:13:36,380 pool-1-thread-1 DEBUG Stopping 
> LoggerContext[name=60199c81, 
> org.apache.logging.log4j.core.LoggerContext@4597ec68]...
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=StatusLogger]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 1 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=ContextSelector]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Loggers,name=bug, 
> org.apache.logging.log4j2:type=60199c81,component=Lo
> ggers,name=]
> 2016-12-22 22:13:36,381 pool-1-thread-1 TRACE Unregistering 2 MBeans: 
> [org.apache.logging.log4j2:type=60199c81,component=Appenders,name=roll-by-size,
>  org.apache.logging.log4j2:type=60199c81,c
> omponent=Appenders,name=stdout]
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncAppenders,name=*'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=AsyncLoggerRingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Unregistering but no MBeans 
> found matching 
> 'org.apache.logging.log4j2:type=60199c81,component=Loggers,name=*,subtype=RingBuffer'
> 2016-12-22 22:13:36,382 pool-1-thread-1 TRACE Stopping 
> XmlConfiguration[location=C:\Users\danidemi\workspace\bug-log4j2-hanging-up-before-shutdown\target\classes\log4j2.xml]...
> 2016-12-22 22:13:36,382 

JDK 9 EA Build 151 is available on java.net

2017-01-10 Thread Rory O'Donnell


Hi Nick,

Best wishes for the New Year.

Dalibor and I will be at FOSDEM '17, Brussels 4 & 5 February. Let us 
know if you will be there, hopefully we can meet up !


*JDK 9 Early Access* b151   is 
available on java.net


There have been a number of fixes to bugs reported by Open Source 
projects since the last availability email  :


 * JDK-8171377 : Add sun.misc.Unsafe::invokeCleaner
 * JDK-8075793 : Source incompatibility for inference using -source 7
 * JDK-8087303  : LSSerializer pretty print does not work anymore
 * JDK-8167143 :CLDR timezone parsing does not work for all locales

Other changes that maybe of interest:

 * JDK-8066474 : Remove the lib/$ARCH directory from Linux and Solaris
   images
 * JDK-8170428 : Move src.zip to JDK/lib/src.zip

*JEPs intergrated:*

 * JEP 295 : Ahead-of-Time
   Compilation has been integrated in b150.

*Schedule - Milestones since last availability email *

 * *Feature Extension Complete 22nd of December 2016*
 * *Rampdown Started 5th of January 2017
   *
 o Phases in which increasing levels of scrutiny are applied to
   incoming changes.
 o In phase 1, only P1-P3 bugs can be fixed. In phase 2 only
   showstopper bugs can be fixed.

Rgds,Rory

--
Rgds,Rory O'Donnell
Quality Engineering Manager
Oracle EMEA , Dublin, Ireland