[jira] [Commented] (LOG4J2-625) Serialization error with SocketAppender and Asynch Logger
[ https://issues.apache.org/jira/browse/LOG4J2-625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14050749#comment-14050749 ] Bryan Hsueh commented on LOG4J2-625: just tested with RC2 and worked, thanks! Serialization error with SocketAppender and Asynch Logger - Key: LOG4J2-625 URL: https://issues.apache.org/jira/browse/LOG4J2-625 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04, Java 7 Reporter: Bryan Hsueh Assignee: Remko Popma I'm testing a simple SocketAppender, which works fine until I switch to asynchronous loggers. Once I turn on async logging, I get: 2014-04-29 21:17:26,029 ERROR Serialization of LogEvent failed. java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at org.apache.logging.log4j.core.layout.SerializedLayout.toByteArray(SerializedLayout.java:64) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:118) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406) at org.apache.logging.log4j.core.Logger$PrivateConfig.logEvent(Logger.java:275) at org.apache.logging.log4j.core.async.AsyncLogger.actualAsyncLog(AsyncLogger.java:289) at org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:99) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:43) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:28) at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) My client is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console Socket name=MySocket host=localhost port= SerializedLayout / /Socket /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ AppenderRef ref=MySocket/ /Root /Loggers /Configuration My server is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ /Root /Loggers /Configuration The client just does a LogManager.getLogger().info({}, hello). The server just creates a SocketServer: SocketServer server = new SocketServer(); server.run(); All works fine until I add this into the client: System.setProperty(Log4jContextSelector, org.apache.logging.log4j.core.async.AsyncLoggerContextSelector); Am I missing something? Please advise. Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Created] (LOG4J2-698) How do I adjust for daylight savings?
Bryan Hsueh created LOG4J2-698: -- Summary: How do I adjust for daylight savings? Key: LOG4J2-698 URL: https://issues.apache.org/jira/browse/LOG4J2-698 Project: Log4j 2 Issue Type: Question Components: Layouts Affects Versions: 2.0-rc2 Environment: Ubuntu 12.04 Reporter: Bryan Hsueh I am using PatternLayout pattern=%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n/ and consuming time in GMT. When I cross daylight savings, my log hour changes. How do I make this consistent? Specifically, I'm UTC-5 right now, and come winter, I want to log as UTC-6. Thanks. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Closed] (LOG4J2-625) Serialization error with SocketAppender and Asynch Logger
[ https://issues.apache.org/jira/browse/LOG4J2-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Hsueh closed LOG4J2-625. -- Resolution: Fixed Fix Version/s: 2.0-rc2 Serialization error with SocketAppender and Asynch Logger - Key: LOG4J2-625 URL: https://issues.apache.org/jira/browse/LOG4J2-625 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04, Java 7 Reporter: Bryan Hsueh Assignee: Remko Popma Fix For: 2.0-rc2 I'm testing a simple SocketAppender, which works fine until I switch to asynchronous loggers. Once I turn on async logging, I get: 2014-04-29 21:17:26,029 ERROR Serialization of LogEvent failed. java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at org.apache.logging.log4j.core.layout.SerializedLayout.toByteArray(SerializedLayout.java:64) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:118) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406) at org.apache.logging.log4j.core.Logger$PrivateConfig.logEvent(Logger.java:275) at org.apache.logging.log4j.core.async.AsyncLogger.actualAsyncLog(AsyncLogger.java:289) at org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:99) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:43) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:28) at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) My client is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console Socket name=MySocket host=localhost port= SerializedLayout / /Socket /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ AppenderRef ref=MySocket/ /Root /Loggers /Configuration My server is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ /Root /Loggers /Configuration The client just does a LogManager.getLogger().info({}, hello). The server just creates a SocketServer: SocketServer server = new SocketServer(); server.run(); All works fine until I add this into the client: System.setProperty(Log4jContextSelector, org.apache.logging.log4j.core.async.AsyncLoggerContextSelector); Am I missing something? Please advise. Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Updated] (LOG4J2-698) How does log4j2 handle daylight savings?
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Hsueh updated LOG4J2-698: --- Summary: How does log4j2 handle daylight savings? (was: How do I adjust for daylight savings?) How does log4j2 handle daylight savings? Key: LOG4J2-698 URL: https://issues.apache.org/jira/browse/LOG4J2-698 Project: Log4j 2 Issue Type: Question Components: Layouts Affects Versions: 2.0-rc2 Environment: Ubuntu 12.04 Reporter: Bryan Hsueh How come PatternLayout pattern=%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n/ does not produce the same log timestamp as PatternLayout pattern=%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n/? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Updated] (LOG4J2-698) How do I adjust for daylight savings?
[ https://issues.apache.org/jira/browse/LOG4J2-698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Hsueh updated LOG4J2-698: --- Description: How come PatternLayout pattern=%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n/ does not produce the same log timestamp as PatternLayout pattern=%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n/? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter.(was: I am using PatternLayout pattern=%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n/ and consuming time in GMT. When I cross daylight savings, my log hour changes. How do I make this consistent? Specifically, I'm UTC-5 right now, and come winter, I want to log as UTC-6. Thanks.) How do I adjust for daylight savings? - Key: LOG4J2-698 URL: https://issues.apache.org/jira/browse/LOG4J2-698 Project: Log4j 2 Issue Type: Question Components: Layouts Affects Versions: 2.0-rc2 Environment: Ubuntu 12.04 Reporter: Bryan Hsueh How come PatternLayout pattern=%d{HH:mm:ss.SSS}{CST} %-5level- %msg%n/ does not produce the same log timestamp as PatternLayout pattern=%d{HH:mm:ss.SSS}{GMT-5} %-5level- %msg%n/? Isn't CST GMT-5 right now? It's logging CST as if it's GMT-6, which isn't until winter. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-628) Cannot set log4j.Clock with Async appender
[ https://issues.apache.org/jira/browse/LOG4J2-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989899#comment-13989899 ] Bryan Hsueh commented on LOG4J2-628: Tested, and works, thanks. I see this message log 7 times at the start though, ERROR StatusLogger Unable to locate ServletContext. Does this have to do with my build process? Likewise, I can no longer find SocketServer. I pulled your revision from github and followed the build instructions. Cannot set log4j.Clock with Async appender -- Key: LOG4J2-628 URL: https://issues.apache.org/jira/browse/LOG4J2-628 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04 / Java 7 Reporter: Bryan Hsueh Assignee: Remko Popma Fix For: 2.0-rc2 I override log4j.Clock to support a live time vs a simulated time. System.setProperty(log4j.Clock, teambh.trade.utils.MyClock); If I use asynchronous loggers, it works fine and calls my Clock:currentTimeMillis(). If I switch to async appenders, currentTimeMillis() is not called. Is this expected behavior or a bug? Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Closed] (LOG4J2-628) Cannot set log4j.Clock with Async appender
[ https://issues.apache.org/jira/browse/LOG4J2-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bryan Hsueh closed LOG4J2-628. -- Cannot set log4j.Clock with Async appender -- Key: LOG4J2-628 URL: https://issues.apache.org/jira/browse/LOG4J2-628 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04 / Java 7 Reporter: Bryan Hsueh Assignee: Remko Popma Fix For: 2.0-rc2 I override log4j.Clock to support a live time vs a simulated time. System.setProperty(log4j.Clock, teambh.trade.utils.MyClock); If I use asynchronous loggers, it works fine and calls my Clock:currentTimeMillis(). If I switch to async appenders, currentTimeMillis() is not called. Is this expected behavior or a bug? Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-628) Cannot set log4j.Clock with Async appender
[ https://issues.apache.org/jira/browse/LOG4J2-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988595#comment-13988595 ] Bryan Hsueh commented on LOG4J2-628: Sorry, I don't use the RolloverAppender, so I'll have to defer to your comments here. Thanks. Cannot set log4j.Clock with Async appender -- Key: LOG4J2-628 URL: https://issues.apache.org/jira/browse/LOG4J2-628 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04 / Java 7 Reporter: Bryan Hsueh Assignee: Remko Popma I override log4j.Clock to support a live time vs a simulated time. System.setProperty(log4j.Clock, teambh.trade.utils.MyClock); If I use asynchronous loggers, it works fine and calls my Clock:currentTimeMillis(). If I switch to async appenders, currentTimeMillis() is not called. Is this expected behavior or a bug? Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Commented] (LOG4J2-628) Cannot set log4j.Clock with Async appender
[ https://issues.apache.org/jira/browse/LOG4J2-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13986881#comment-13986881 ] Bryan Hsueh commented on LOG4J2-628: Correct, my use case is not performance related. Instead, I implement Clock so that I can decide whether to use System time or my own artificial, simulated time. I am simulating a program against historical data. So, when I run historically, I want to see my historical timestamp. When I run live, I want to see the System timestamp. My Clock:currentTimeMillis() decides this for me. Cannot set log4j.Clock with Async appender -- Key: LOG4J2-628 URL: https://issues.apache.org/jira/browse/LOG4J2-628 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04 / Java 7 Reporter: Bryan Hsueh I override log4j.Clock to support a live time vs a simulated time. System.setProperty(log4j.Clock, teambh.trade.utils.MyClock); If I use asynchronous loggers, it works fine and calls my Clock:currentTimeMillis(). If I switch to async appenders, currentTimeMillis() is not called. Is this expected behavior or a bug? Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Created] (LOG4J2-628) Cannot set log4j.Clock with Async appender
Bryan Hsueh created LOG4J2-628: -- Summary: Cannot set log4j.Clock with Async appender Key: LOG4J2-628 URL: https://issues.apache.org/jira/browse/LOG4J2-628 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04 / Java 7 Reporter: Bryan Hsueh I override log4j.Clock to support a live time vs a simulated time. System.setProperty(log4j.Clock, teambh.trade.utils.MyClock); If I use asynchronous loggers, it works fine and calls my Clock:currentTimeMillis(). If I switch to async appenders, currentTimeMillis() is not called. Is this expected behavior or a bug? Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org
[jira] [Created] (LOG4J2-625) Serialization error with SocketAppender and Asynch Logger
Bryan Hsueh created LOG4J2-625: -- Summary: Serialization error with SocketAppender and Asynch Logger Key: LOG4J2-625 URL: https://issues.apache.org/jira/browse/LOG4J2-625 Project: Log4j 2 Issue Type: Question Components: Appenders Affects Versions: 2.0-rc1 Environment: Ubuntu 12.04, Java 7 Reporter: Bryan Hsueh I'm testing a simple SocketAppender, which works fine until I switch to asynchronous loggers. Once I turn on async logging, I get: 2014-04-29 21:17:26,029 ERROR Serialization of LogEvent failed. java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at org.apache.logging.log4j.core.layout.SerializedLayout.toByteArray(SerializedLayout.java:64) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:118) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406) at org.apache.logging.log4j.core.Logger$PrivateConfig.logEvent(Logger.java:275) at org.apache.logging.log4j.core.async.AsyncLogger.actualAsyncLog(AsyncLogger.java:289) at org.apache.logging.log4j.core.async.RingBufferLogEvent.execute(RingBufferLogEvent.java:99) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:43) at org.apache.logging.log4j.core.async.RingBufferLogEventHandler.onEvent(RingBufferLogEventHandler.java:28) at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) My client is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console Socket name=MySocket host=localhost port= SerializedLayout / /Socket /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ AppenderRef ref=MySocket/ /Root /Loggers /Configuration My server is configured with: ?xml version=1.0 encoding=UTF-8? Configuration status=INFO Appenders Console name=MyConsole target=SYSTEM_OUT PatternLayout pattern=%d{HH:mm:ss.SSS}{EST} %-5level- %msg%n/ /Console /Appenders Loggers Root level=INFO AppenderRef ref=MyConsole/ /Root /Loggers /Configuration The client just does a LogManager.getLogger().info({}, hello). The server just creates a SocketServer: SocketServer server = new SocketServer(); server.run(); All works fine until I add this into the client: System.setProperty(Log4jContextSelector, org.apache.logging.log4j.core.async.AsyncLoggerContextSelector); Am I missing something? Please advise. Thanks -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-dev-h...@logging.apache.org