You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2017/04/03 22:30:13 UTC
MessageLayout
Hi All,
I am considering a new layout called "MessageLayout" which would be
synonymous with:<PatternLayout pattern="%m" />. Thoughts?
Gary
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: MessageLayout
Posted by Ralph Goers <ra...@dslextreme.com>.
No. JMS does not guarantee delivery in the way your would want. Sure, if the JMS service says it accepted the event then it is guaranteed, but if it doesn’t what are you going to do with the event? It is stuck in the client. You would have to invent some way to queue the events and then retry them later.
The Flume Appender writes the event into a channel in the client and then gives control back to you. From that point on delivery is guaranteed downstream. It uses a separate thread to pull from the channel and write to a downstream flume agent. That agent can use any of the sinks that Flume provides to write the data to Kafka, Hadoop, ElasticSearch, etc. or you can write a custom Sink to do whatever you want. I used Flume at my previous employer and am using it currently and I can tell you that it is extremely reliable and the throughput is pretty good.
Yes, logging asynchronously is unsafe because all in-flight events will be lost. That is fine for normal debug logs but is unacceptable for auditing. Again, because Flume writes to the file channel that won’t happen unless you disk is full.
If you use JMS then you have to handle the case where event delivery fails for whatever reason, or you have to require that your JMS service is 100% reliable.
Ralph
> On Apr 3, 2017, at 5:45 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Wait a sec. A JMS provider can guarantee message delivery. How can events be lost once they are in the provider? Are you saying that using an async logger is 'unsafe' because the events in the ring buffer go away if the JVM goes down?
>
> Ideally I want to publish and forget, with the publish part asynchronous, call the API, and it returns right away.
>
> Is there no way to do that with our JMS Appender?
>
> Gary
>
> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ralph.goers@dslextreme.com <ma...@dslextreme.com>> wrote:
> What’s the point though when all you have to do is specify the pattern layout with “%m%ex{none}”?
>
> How can you do auditing with the async logger? You may lose events with that.
>
> Your use case is exactly why I wrote the FlumeAppender. It is very much like JMS but a whole lot faster and guarantees events aren’t lost.
>
> Ralph
>
>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>>
>> Right. I want to post to JMS message objects I've serialized to JSON. All I care about is the message.
>>
>> I log these events to a specially named logger with a specially named marker. These are the only events that should be published to JMS (I use a filter and the one marker). I am in charge of the message format and it is consumed on the other JMS side by a specialized agent which I also control.
>>
>> IOW, I am using the Log4j infrastructure as the simplest way to send custom messages over to JMS. These are not traditional logging events, rather a kind of auditing system. I leverage the Log4j async logger as well. No need to deal with the JMS API.
>>
>> Gary
>>
>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <remko.popma@gmail.com <ma...@gmail.com>> wrote:
>> So, exceptions are swallowed and no newlines are rendered? Interesting.
>> What's the use case?
>>
>> Sent from my iPhone
>>
>> On Apr 4, 2017, at 7:30, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>>
>>> Hi All,
>>>
>>> I am considering a new layout called "MessageLayout" which would be synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
>>> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
>>> Home: http://garygregory.com/ <http://garygregory.com/>
>>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
>> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
>> Home: http://garygregory.com/ <http://garygregory.com/>
>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>
>
>
> --
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
Re: MessageLayout
Posted by Gary Gregory <ga...@gmail.com>.
Roger that! Thank you all for your comments. Flume with unique keys it is.
Gary
On Mon, Apr 3, 2017 at 10:15 PM, Ralph Goers <ra...@dslextreme.com>
wrote:
> Again, if you use an async logger you will lose whatever is in the memory
> buffer when the server stops or crashes. If you log directly to Flume you
> are guaranteed that the audit event is written when the logging call
> returns and your application can count on that.
>
> The only thing you really need to be aware of is that in an HA
> configuration it is possible to end up with multiple instances of the event
> in the final repository so you need to make sure your events include a
> unique key that can be used to remove duplicates.
>
> Ralph
>
> On Apr 3, 2017, at 8:40 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Thanks Matt. With the Flume appender, do I still need to use an async
> logger to get the best perf?
>
> Gary
>
> On Mon, Apr 3, 2017 at 8:31 PM, Matt Sicker <bo...@gmail.com> wrote:
>
>> Clarifications: other than the file appenders, the flume appender is
>> probably the most reliable appender.
>>
>> And for the direct appender config, that's also with fully async loggers.
>> I've been considering putting together a small blog post about the most
>> efficient log4j2.xml configurations.
>>
>> On 3 April 2017 at 22:01, Matt Sicker <bo...@gmail.com> wrote:
>>
>>> The Flume appender can persist messages within the same process to files
>>> before sending them to other agents. I don't think any other appender can
>>> guarantee that.
>>>
>>> Personally, I've been using direct console appenders lately and using
>>> graylog to slurp stdout on docker containers, but I'm not the one who set
>>> all that up. Either way, the most reliable way to log things outside of
>>> files is Flume.
>>>
>>> On 3 April 2017 at 19:45, Gary Gregory <ga...@gmail.com> wrote:
>>>
>>>> Wait a sec. A JMS provider can guarantee message delivery. How can
>>>> events be lost once they are in the provider? Are you saying that using an
>>>> async logger is 'unsafe' because the events in the ring buffer go away if
>>>> the JVM goes down?
>>>>
>>>> Ideally I want to publish and forget, with the publish part
>>>> asynchronous, call the API, and it returns right away.
>>>>
>>>> Is there no way to do that with our JMS Appender?
>>>>
>>>> Gary
>>>>
>>>> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ralph.goers@dslextreme.com
>>>> > wrote:
>>>>
>>>>> What’s the point though when all you have to do is specify the pattern
>>>>> layout with “%m%ex{none}”?
>>>>>
>>>>> How can you do auditing with the async logger? You may lose events
>>>>> with that.
>>>>>
>>>>> Your use case is exactly why I wrote the FlumeAppender. It is very
>>>>> much like JMS but a whole lot faster and guarantees events aren’t lost.
>>>>>
>>>>> Ralph
>>>>>
>>>>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com>
>>>>> wrote:
>>>>>
>>>>> Right. I want to post to JMS message objects I've serialized to JSON.
>>>>> All I care about is the message.
>>>>>
>>>>> I log these events to a specially named logger with a specially named
>>>>> marker. These are the only events that should be published to JMS (I use a
>>>>> filter and the one marker). I am in charge of the message format and it is
>>>>> consumed on the other JMS side by a specialized agent which I also control.
>>>>>
>>>>> IOW, I am using the Log4j infrastructure as the simplest way to send
>>>>> custom messages over to JMS. These are not traditional logging events,
>>>>> rather a kind of auditing system. I leverage the Log4j async logger as
>>>>> well. No need to deal with the JMS API.
>>>>>
>>>>> Gary
>>>>>
>>>>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> So, exceptions are swallowed and no newlines are rendered?
>>>>>> Interesting.
>>>>>> What's the use case?
>>>>>>
>>>>>> Sent from my iPhone
>>>>>>
>>>>>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am considering a new layout called "MessageLayout" which would be
>>>>>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>>>>
>>>>>> Gary
>>>>>>
>>>>>> --
>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>>> Java Persistence with Hibernate, Second Edition
>>>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>>>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>>>> JUnit in Action, Second Edition
>>>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>>>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>>>> Spring Batch in Action
>>>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>>>> Blog: http://garygregory.wordpress.com
>>>>>> Home: http://garygregory.com/
>>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>> Java Persistence with Hibernate, Second Edition
>>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>>> JUnit in Action, Second Edition
>>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>>> Spring Batch in Action
>>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>>> Blog: http://garygregory.wordpress.com
>>>>> Home: http://garygregory.com/
>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>> JUnit in Action, Second Edition
>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>> Spring Batch in Action
>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: MessageLayout
Posted by Ralph Goers <ra...@dslextreme.com>.
Again, if you use an async logger you will lose whatever is in the memory buffer when the server stops or crashes. If you log directly to Flume you are guaranteed that the audit event is written when the logging call returns and your application can count on that.
The only thing you really need to be aware of is that in an HA configuration it is possible to end up with multiple instances of the event in the final repository so you need to make sure your events include a unique key that can be used to remove duplicates.
Ralph
> On Apr 3, 2017, at 8:40 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Thanks Matt. With the Flume appender, do I still need to use an async logger to get the best perf?
>
> Gary
>
> On Mon, Apr 3, 2017 at 8:31 PM, Matt Sicker <boards@gmail.com <ma...@gmail.com>> wrote:
> Clarifications: other than the file appenders, the flume appender is probably the most reliable appender.
>
> And for the direct appender config, that's also with fully async loggers. I've been considering putting together a small blog post about the most efficient log4j2.xml configurations.
>
> On 3 April 2017 at 22:01, Matt Sicker <boards@gmail.com <ma...@gmail.com>> wrote:
> The Flume appender can persist messages within the same process to files before sending them to other agents. I don't think any other appender can guarantee that.
>
> Personally, I've been using direct console appenders lately and using graylog to slurp stdout on docker containers, but I'm not the one who set all that up. Either way, the most reliable way to log things outside of files is Flume.
>
> On 3 April 2017 at 19:45, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
> Wait a sec. A JMS provider can guarantee message delivery. How can events be lost once they are in the provider? Are you saying that using an async logger is 'unsafe' because the events in the ring buffer go away if the JVM goes down?
>
> Ideally I want to publish and forget, with the publish part asynchronous, call the API, and it returns right away.
>
> Is there no way to do that with our JMS Appender?
>
> Gary
>
> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ralph.goers@dslextreme.com <ma...@dslextreme.com>> wrote:
> What’s the point though when all you have to do is specify the pattern layout with “%m%ex{none}”?
>
> How can you do auditing with the async logger? You may lose events with that.
>
> Your use case is exactly why I wrote the FlumeAppender. It is very much like JMS but a whole lot faster and guarantees events aren’t lost.
>
> Ralph
>
>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>>
>> Right. I want to post to JMS message objects I've serialized to JSON. All I care about is the message.
>>
>> I log these events to a specially named logger with a specially named marker. These are the only events that should be published to JMS (I use a filter and the one marker). I am in charge of the message format and it is consumed on the other JMS side by a specialized agent which I also control.
>>
>> IOW, I am using the Log4j infrastructure as the simplest way to send custom messages over to JMS. These are not traditional logging events, rather a kind of auditing system. I leverage the Log4j async logger as well. No need to deal with the JMS API.
>>
>> Gary
>>
>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <remko.popma@gmail.com <ma...@gmail.com>> wrote:
>> So, exceptions are swallowed and no newlines are rendered? Interesting.
>> What's the use case?
>>
>> Sent from my iPhone
>>
>> On Apr 4, 2017, at 7:30, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>>
>>> Hi All,
>>>
>>> I am considering a new layout called "MessageLayout" which would be synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
>>> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
>>> Home: http://garygregory.com/ <http://garygregory.com/>
>>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
>> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
>> Home: http://garygregory.com/ <http://garygregory.com/>
>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>
>
>
> --
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>
>
> --
> Matt Sicker <boards@gmail.com <ma...@gmail.com>>
>
>
>
> --
> Matt Sicker <boards@gmail.com <ma...@gmail.com>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
Re: MessageLayout
Posted by Matt Sicker <bo...@gmail.com>.
I'm pretty sure you do, yes, though the async loggers do have less
reliability in theory due to more log messages being buffered in memory
before being written, so more messages could be lost in case of failure.
That's configurable to whatever level of reliability you want, though.
On 3 April 2017 at 22:40, Gary Gregory <ga...@gmail.com> wrote:
> Thanks Matt. With the Flume appender, do I still need to use an async
> logger to get the best perf?
>
> Gary
>
> On Mon, Apr 3, 2017 at 8:31 PM, Matt Sicker <bo...@gmail.com> wrote:
>
>> Clarifications: other than the file appenders, the flume appender is
>> probably the most reliable appender.
>>
>> And for the direct appender config, that's also with fully async loggers.
>> I've been considering putting together a small blog post about the most
>> efficient log4j2.xml configurations.
>>
>> On 3 April 2017 at 22:01, Matt Sicker <bo...@gmail.com> wrote:
>>
>>> The Flume appender can persist messages within the same process to files
>>> before sending them to other agents. I don't think any other appender can
>>> guarantee that.
>>>
>>> Personally, I've been using direct console appenders lately and using
>>> graylog to slurp stdout on docker containers, but I'm not the one who set
>>> all that up. Either way, the most reliable way to log things outside of
>>> files is Flume.
>>>
>>> On 3 April 2017 at 19:45, Gary Gregory <ga...@gmail.com> wrote:
>>>
>>>> Wait a sec. A JMS provider can guarantee message delivery. How can
>>>> events be lost once they are in the provider? Are you saying that using an
>>>> async logger is 'unsafe' because the events in the ring buffer go away if
>>>> the JVM goes down?
>>>>
>>>> Ideally I want to publish and forget, with the publish part
>>>> asynchronous, call the API, and it returns right away.
>>>>
>>>> Is there no way to do that with our JMS Appender?
>>>>
>>>> Gary
>>>>
>>>> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ralph.goers@dslextreme.com
>>>> > wrote:
>>>>
>>>>> What’s the point though when all you have to do is specify the pattern
>>>>> layout with “%m%ex{none}”?
>>>>>
>>>>> How can you do auditing with the async logger? You may lose events
>>>>> with that.
>>>>>
>>>>> Your use case is exactly why I wrote the FlumeAppender. It is very
>>>>> much like JMS but a whole lot faster and guarantees events aren’t lost.
>>>>>
>>>>> Ralph
>>>>>
>>>>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com>
>>>>> wrote:
>>>>>
>>>>> Right. I want to post to JMS message objects I've serialized to JSON.
>>>>> All I care about is the message.
>>>>>
>>>>> I log these events to a specially named logger with a specially named
>>>>> marker. These are the only events that should be published to JMS (I use a
>>>>> filter and the one marker). I am in charge of the message format and it is
>>>>> consumed on the other JMS side by a specialized agent which I also control.
>>>>>
>>>>> IOW, I am using the Log4j infrastructure as the simplest way to send
>>>>> custom messages over to JMS. These are not traditional logging events,
>>>>> rather a kind of auditing system. I leverage the Log4j async logger as
>>>>> well. No need to deal with the JMS API.
>>>>>
>>>>> Gary
>>>>>
>>>>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> So, exceptions are swallowed and no newlines are rendered?
>>>>>> Interesting.
>>>>>> What's the use case?
>>>>>>
>>>>>> Sent from my iPhone
>>>>>>
>>>>>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> I am considering a new layout called "MessageLayout" which would be
>>>>>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>>>>
>>>>>> Gary
>>>>>>
>>>>>> --
>>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>>> Java Persistence with Hibernate, Second Edition
>>>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>>>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>>>> JUnit in Action, Second Edition
>>>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>>>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>>>> Spring Batch in Action
>>>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>>>> Blog: http://garygregory.wordpress.com
>>>>>> Home: http://garygregory.com/
>>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>> Java Persistence with Hibernate, Second Edition
>>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>>> JUnit in Action, Second Edition
>>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>>> Spring Batch in Action
>>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>>> Blog: http://garygregory.wordpress.com
>>>>> Home: http://garygregory.com/
>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>
>>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>> JUnit in Action, Second Edition
>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>
>>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>> Spring Batch in Action
>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
--
Matt Sicker <bo...@gmail.com>
Re: MessageLayout
Posted by Gary Gregory <ga...@gmail.com>.
Thanks Matt. With the Flume appender, do I still need to use an async
logger to get the best perf?
Gary
On Mon, Apr 3, 2017 at 8:31 PM, Matt Sicker <bo...@gmail.com> wrote:
> Clarifications: other than the file appenders, the flume appender is
> probably the most reliable appender.
>
> And for the direct appender config, that's also with fully async loggers.
> I've been considering putting together a small blog post about the most
> efficient log4j2.xml configurations.
>
> On 3 April 2017 at 22:01, Matt Sicker <bo...@gmail.com> wrote:
>
>> The Flume appender can persist messages within the same process to files
>> before sending them to other agents. I don't think any other appender can
>> guarantee that.
>>
>> Personally, I've been using direct console appenders lately and using
>> graylog to slurp stdout on docker containers, but I'm not the one who set
>> all that up. Either way, the most reliable way to log things outside of
>> files is Flume.
>>
>> On 3 April 2017 at 19:45, Gary Gregory <ga...@gmail.com> wrote:
>>
>>> Wait a sec. A JMS provider can guarantee message delivery. How can
>>> events be lost once they are in the provider? Are you saying that using an
>>> async logger is 'unsafe' because the events in the ring buffer go away if
>>> the JVM goes down?
>>>
>>> Ideally I want to publish and forget, with the publish part
>>> asynchronous, call the API, and it returns right away.
>>>
>>> Is there no way to do that with our JMS Appender?
>>>
>>> Gary
>>>
>>> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ra...@dslextreme.com>
>>> wrote:
>>>
>>>> What’s the point though when all you have to do is specify the pattern
>>>> layout with “%m%ex{none}”?
>>>>
>>>> How can you do auditing with the async logger? You may lose events with
>>>> that.
>>>>
>>>> Your use case is exactly why I wrote the FlumeAppender. It is very much
>>>> like JMS but a whole lot faster and guarantees events aren’t lost.
>>>>
>>>> Ralph
>>>>
>>>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com>
>>>> wrote:
>>>>
>>>> Right. I want to post to JMS message objects I've serialized to JSON.
>>>> All I care about is the message.
>>>>
>>>> I log these events to a specially named logger with a specially named
>>>> marker. These are the only events that should be published to JMS (I use a
>>>> filter and the one marker). I am in charge of the message format and it is
>>>> consumed on the other JMS side by a specialized agent which I also control.
>>>>
>>>> IOW, I am using the Log4j infrastructure as the simplest way to send
>>>> custom messages over to JMS. These are not traditional logging events,
>>>> rather a kind of auditing system. I leverage the Log4j async logger as
>>>> well. No need to deal with the JMS API.
>>>>
>>>> Gary
>>>>
>>>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com>
>>>> wrote:
>>>>
>>>>> So, exceptions are swallowed and no newlines are rendered?
>>>>> Interesting.
>>>>> What's the use case?
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>>>>
>>>>> Hi All,
>>>>>
>>>>> I am considering a new layout called "MessageLayout" which would be
>>>>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>>>
>>>>> Gary
>>>>>
>>>>> --
>>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>>> Java Persistence with Hibernate, Second Edition
>>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>>> JUnit in Action, Second Edition
>>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>>> Spring Batch in Action
>>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>>> Blog: http://garygregory.wordpress.com
>>>>> Home: http://garygregory.com/
>>>>> Tweet! http://twitter.com/GaryGregory
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>> JUnit in Action, Second Edition
>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>> Spring Batch in Action
>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>
>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>> JUnit in Action, Second Edition
>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>
>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>> Spring Batch in Action
>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: MessageLayout
Posted by Matt Sicker <bo...@gmail.com>.
Clarifications: other than the file appenders, the flume appender is
probably the most reliable appender.
And for the direct appender config, that's also with fully async loggers.
I've been considering putting together a small blog post about the most
efficient log4j2.xml configurations.
On 3 April 2017 at 22:01, Matt Sicker <bo...@gmail.com> wrote:
> The Flume appender can persist messages within the same process to files
> before sending them to other agents. I don't think any other appender can
> guarantee that.
>
> Personally, I've been using direct console appenders lately and using
> graylog to slurp stdout on docker containers, but I'm not the one who set
> all that up. Either way, the most reliable way to log things outside of
> files is Flume.
>
> On 3 April 2017 at 19:45, Gary Gregory <ga...@gmail.com> wrote:
>
>> Wait a sec. A JMS provider can guarantee message delivery. How can events
>> be lost once they are in the provider? Are you saying that using an async
>> logger is 'unsafe' because the events in the ring buffer go away if the JVM
>> goes down?
>>
>> Ideally I want to publish and forget, with the publish part asynchronous,
>> call the API, and it returns right away.
>>
>> Is there no way to do that with our JMS Appender?
>>
>> Gary
>>
>> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ra...@dslextreme.com>
>> wrote:
>>
>>> What’s the point though when all you have to do is specify the pattern
>>> layout with “%m%ex{none}”?
>>>
>>> How can you do auditing with the async logger? You may lose events with
>>> that.
>>>
>>> Your use case is exactly why I wrote the FlumeAppender. It is very much
>>> like JMS but a whole lot faster and guarantees events aren’t lost.
>>>
>>> Ralph
>>>
>>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com> wrote:
>>>
>>> Right. I want to post to JMS message objects I've serialized to JSON.
>>> All I care about is the message.
>>>
>>> I log these events to a specially named logger with a specially named
>>> marker. These are the only events that should be published to JMS (I use a
>>> filter and the one marker). I am in charge of the message format and it is
>>> consumed on the other JMS side by a specialized agent which I also control.
>>>
>>> IOW, I am using the Log4j infrastructure as the simplest way to send
>>> custom messages over to JMS. These are not traditional logging events,
>>> rather a kind of auditing system. I leverage the Log4j async logger as
>>> well. No need to deal with the JMS API.
>>>
>>> Gary
>>>
>>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com>
>>> wrote:
>>>
>>>> So, exceptions are swallowed and no newlines are rendered? Interesting.
>>>> What's the use case?
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> I am considering a new layout called "MessageLayout" which would be
>>>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>>
>>>> Gary
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>>> JUnit in Action, Second Edition
>>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>>> Spring Batch in Action
>>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>>
>>>
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>> JUnit in Action, Second Edition
>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>> Spring Batch in Action
>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>
>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition
>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>
>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action
>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
--
Matt Sicker <bo...@gmail.com>
Re: MessageLayout
Posted by Matt Sicker <bo...@gmail.com>.
The Flume appender can persist messages within the same process to files
before sending them to other agents. I don't think any other appender can
guarantee that.
Personally, I've been using direct console appenders lately and using
graylog to slurp stdout on docker containers, but I'm not the one who set
all that up. Either way, the most reliable way to log things outside of
files is Flume.
On 3 April 2017 at 19:45, Gary Gregory <ga...@gmail.com> wrote:
> Wait a sec. A JMS provider can guarantee message delivery. How can events
> be lost once they are in the provider? Are you saying that using an async
> logger is 'unsafe' because the events in the ring buffer go away if the JVM
> goes down?
>
> Ideally I want to publish and forget, with the publish part asynchronous,
> call the API, and it returns right away.
>
> Is there no way to do that with our JMS Appender?
>
> Gary
>
> On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ra...@dslextreme.com>
> wrote:
>
>> What’s the point though when all you have to do is specify the pattern
>> layout with “%m%ex{none}”?
>>
>> How can you do auditing with the async logger? You may lose events with
>> that.
>>
>> Your use case is exactly why I wrote the FlumeAppender. It is very much
>> like JMS but a whole lot faster and guarantees events aren’t lost.
>>
>> Ralph
>>
>> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com> wrote:
>>
>> Right. I want to post to JMS message objects I've serialized to JSON. All
>> I care about is the message.
>>
>> I log these events to a specially named logger with a specially named
>> marker. These are the only events that should be published to JMS (I use a
>> filter and the one marker). I am in charge of the message format and it is
>> consumed on the other JMS side by a specialized agent which I also control.
>>
>> IOW, I am using the Log4j infrastructure as the simplest way to send
>> custom messages over to JMS. These are not traditional logging events,
>> rather a kind of auditing system. I leverage the Log4j async logger as
>> well. No need to deal with the JMS API.
>>
>> Gary
>>
>> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com>
>> wrote:
>>
>>> So, exceptions are swallowed and no newlines are rendered? Interesting.
>>> What's the use case?
>>>
>>> Sent from my iPhone
>>>
>>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>>
>>> Hi All,
>>>
>>> I am considering a new layout called "MessageLayout" which would be
>>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>>> JUnit in Action, Second Edition
>>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>>> Spring Batch in Action
>>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>>
>>
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition
>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action
>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
--
Matt Sicker <bo...@gmail.com>
Re: MessageLayout
Posted by Gary Gregory <ga...@gmail.com>.
Wait a sec. A JMS provider can guarantee message delivery. How can events
be lost once they are in the provider? Are you saying that using an async
logger is 'unsafe' because the events in the ring buffer go away if the JVM
goes down?
Ideally I want to publish and forget, with the publish part asynchronous,
call the API, and it returns right away.
Is there no way to do that with our JMS Appender?
Gary
On Mon, Apr 3, 2017 at 5:38 PM, Ralph Goers <ra...@dslextreme.com>
wrote:
> What’s the point though when all you have to do is specify the pattern
> layout with “%m%ex{none}”?
>
> How can you do auditing with the async logger? You may lose events with
> that.
>
> Your use case is exactly why I wrote the FlumeAppender. It is very much
> like JMS but a whole lot faster and guarantees events aren’t lost.
>
> Ralph
>
> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Right. I want to post to JMS message objects I've serialized to JSON. All
> I care about is the message.
>
> I log these events to a specially named logger with a specially named
> marker. These are the only events that should be published to JMS (I use a
> filter and the one marker). I am in charge of the message format and it is
> consumed on the other JMS side by a specialized agent which I also control.
>
> IOW, I am using the Log4j infrastructure as the simplest way to send
> custom messages over to JMS. These are not traditional logging events,
> rather a kind of auditing system. I leverage the Log4j async logger as
> well. No need to deal with the JMS API.
>
> Gary
>
> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com> wrote:
>
>> So, exceptions are swallowed and no newlines are rendered? Interesting.
>> What's the use case?
>>
>> Sent from my iPhone
>>
>> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>>
>> Hi All,
>>
>> I am considering a new layout called "MessageLayout" which would be
>> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition
>> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action
>> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
>> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: MessageLayout
Posted by Ralph Goers <ra...@dslextreme.com>.
What’s the point though when all you have to do is specify the pattern layout with “%m%ex{none}”?
How can you do auditing with the async logger? You may lose events with that.
Your use case is exactly why I wrote the FlumeAppender. It is very much like JMS but a whole lot faster and guarantees events aren’t lost.
Ralph
> On Apr 3, 2017, at 5:03 PM, Gary Gregory <ga...@gmail.com> wrote:
>
> Right. I want to post to JMS message objects I've serialized to JSON. All I care about is the message.
>
> I log these events to a specially named logger with a specially named marker. These are the only events that should be published to JMS (I use a filter and the one marker). I am in charge of the message format and it is consumed on the other JMS side by a specialized agent which I also control.
>
> IOW, I am using the Log4j infrastructure as the simplest way to send custom messages over to JMS. These are not traditional logging events, rather a kind of auditing system. I leverage the Log4j async logger as well. No need to deal with the JMS API.
>
> Gary
>
> On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <remko.popma@gmail.com <ma...@gmail.com>> wrote:
> So, exceptions are swallowed and no newlines are rendered? Interesting.
> What's the use case?
>
> Sent from my iPhone
>
> On Apr 4, 2017, at 7:30, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>
>> Hi All,
>>
>> I am considering a new layout called "MessageLayout" which would be synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
>> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
>> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
>> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
>> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
>> Home: http://garygregory.com/ <http://garygregory.com/>
>> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
>
>
> --
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http://ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com <http://garygregory.wordpress.com/>
> Home: http://garygregory.com/ <http://garygregory.com/>
> Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>
Re: MessageLayout
Posted by Gary Gregory <ga...@gmail.com>.
Right. I want to post to JMS message objects I've serialized to JSON. All I
care about is the message.
I log these events to a specially named logger with a specially named
marker. These are the only events that should be published to JMS (I use a
filter and the one marker). I am in charge of the message format and it is
consumed on the other JMS side by a specialized agent which I also control.
IOW, I am using the Log4j infrastructure as the simplest way to send custom
messages over to JMS. These are not traditional logging events, rather a
kind of auditing system. I leverage the Log4j async logger as well. No need
to deal with the JMS API.
Gary
On Mon, Apr 3, 2017 at 4:07 PM, Remko Popma <re...@gmail.com> wrote:
> So, exceptions are swallowed and no newlines are rendered? Interesting.
> What's the use case?
>
> Sent from my iPhone
>
> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All,
>
> I am considering a new layout called "MessageLayout" which would be
> synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
--
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459>
JUnit in Action, Second Edition
<https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021>
Spring Batch in Action
<https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
<http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Re: MessageLayout
Posted by Remko Popma <re...@gmail.com>.
So, exceptions are swallowed and no newlines are rendered? Interesting.
What's the use case?
Sent from my iPhone
> On Apr 4, 2017, at 7:30, Gary Gregory <ga...@gmail.com> wrote:
>
> Hi All,
>
> I am considering a new layout called "MessageLayout" which would be synonymous with:<PatternLayout pattern="%m" />. Thoughts?
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@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