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 Matt Sicker <bo...@gmail.com> on 2015/10/15 04:51:23 UTC

Re: org.apache.logging.log4j.EventLogger

>From what I can grok, it looks like a way to log map-like messages in a way
that's specified by the new syslog standard. Basically, if you're not using
RFC 5424, it does seem confusing.

On 16 September 2015 at 10:45, Gary Gregory <ga...@gmail.com> wrote:

> What is the point of this class? It does so little... what am I missing?
>
> Some better Javadocs are required to justify its existence IMO.
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <bo...@gmail.com>

Re: org.apache.logging.log4j.EventLogger

Posted by Ralph Goers <ra...@dslextreme.com>.
It takes a StructuredDataMessage because that is what I was using for Audit logging. To be honest, with the audit logging framework the user doesn’t even interact with the Message. The attributes of the Audit event are then placed into the StructuredDataMessage and then the RFC5424 formatted messages are routed through the system.

Ralph

> On Oct 15, 2015, at 5:14 AM, Mikael Ståldal <mi...@magine.com> wrote:
> 
> Is there a specific reason for EventLogger to take a StructuredDataMessage, or can we change it to take a Message to make it more generic?
> 
> On Thu, Oct 15, 2015 at 2:13 PM, Mikael Ståldal <mikael.staldal@magine.com <ma...@magine.com>> wrote:
> I think this code is quite ugly:
>         StructuredDataMessage msg = new StructuredDataMessage(confirm, null, "transfer");
>         msg.put("toAccount", toAccount);
>         msg.put("fromAccount", fromAccount);
>         msg.put("amount", amount);
>         EventLogger.logEvent(msg);
> 
> I would like to be able to do this in one statement.  Perhaps we can extend MapMessage to use a build pattern so you can do something like this:
>         EventLogger.logEvent(
>             new StructuredDataMessage(confirm, null, "transfer")
>                 .withValue("toAccount", toAccount)
>                 .withValue("fromAccount", fromAccount)
>                 .withValue("amount", amount)
>         );
> 
> 
> On Thu, Oct 15, 2015 at 4:57 AM, Ralph Goers <ralph.goers@dslextreme.com <ma...@dslextreme.com>> wrote:
> See http://logging.apache.org/log4j/2.x/manual/eventlogging.html <http://logging.apache.org/log4j/2.x/manual/eventlogging.html>. I used this as the basis for an audit logging system at my former employer. I have every intention of creating a log4j-audit subproject that mimics what was done there. I just need some PTO time to work on it….
> 
> Ralph
> 
> 
> 
>> On Oct 14, 2015, at 7:52 PM, Matt Sicker <boards@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Wait, wait, I was missing an important aspect here. Event logging is a different concept than location-based logging. Think of it as decentralized log messages (somewhat like StatusLogger in that regard).
>> 
>> On 14 October 2015 at 21:51, Matt Sicker <boards@gmail.com <ma...@gmail.com>> wrote:
>> From what I can grok, it looks like a way to log map-like messages in a way that's specified by the new syslog standard. Basically, if you're not using RFC 5424, it does seem confusing.
>> 
>> On 16 September 2015 at 10:45, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
>> What is the point of this class? It does so little... what am I missing?
>> 
>> Some better Javadocs are required to justify its existence IMO.
>> 
>> Gary
>> 
>> -- 
>> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
>> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> 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>>
> 
> 
> 
> 
> -- 
>  
> 
> Mikael Ståldal
> Senior software developer 
> 
> Magine TV
> mikael.staldal@magine.com <ma...@magine.com>    
> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com  <http://www.magine.com/>
> 
> Privileged and/or Confidential Information may be contained in this message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not copy or deliver this message to anyone. In such case, 
> you should destroy this message and kindly notify the sender by reply email.   
> 
> 
> 
> -- 
>  
> 
> Mikael Ståldal
> Senior software developer 
> 
> Magine TV
> mikael.staldal@magine.com <ma...@magine.com>    
> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com  <http://www.magine.com/>
> 
> Privileged and/or Confidential Information may be contained in this message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not copy or deliver this message to anyone. In such case, 
> you should destroy this message and kindly notify the sender by reply email.   


Re: org.apache.logging.log4j.EventLogger

Posted by Mikael Ståldal <mi...@magine.com>.
Is there a specific reason for EventLogger to take a StructuredDataMessage, or
can we change it to take a Message to make it more generic?

On Thu, Oct 15, 2015 at 2:13 PM, Mikael Ståldal <mi...@magine.com>
wrote:

> I think this code is quite ugly:
> StructuredDataMessage msg = new StructuredDataMessage(confirm, null,
> "transfer");
> msg.put("toAccount", toAccount);
> msg.put("fromAccount", fromAccount);
> msg.put("amount", amount);
> EventLogger.logEvent(msg);
>
> I would like to be able to do this in one statement.  Perhaps we can
> extend MapMessage to use a build pattern so you can do something like this:
> EventLogger.logEvent(
> new StructuredDataMessage(confirm, null, "transfer")
> .withValue("toAccount", toAccount)
> .withValue("fromAccount", fromAccount)
> .withValue("amount", amount)
> );
>
>
> On Thu, Oct 15, 2015 at 4:57 AM, Ralph Goers <ra...@dslextreme.com>
> wrote:
>
>> See http://logging.apache.org/log4j/2.x/manual/eventlogging.html. I used
>> this as the basis for an audit logging system at my former employer. I have
>> every intention of creating a log4j-audit subproject that mimics what was
>> done there. I just need some PTO time to work on it….
>>
>> Ralph
>>
>>
>>
>> On Oct 14, 2015, at 7:52 PM, Matt Sicker <bo...@gmail.com> wrote:
>>
>> Wait, wait, I was missing an important aspect here. Event logging is a
>> different concept than location-based logging. Think of it as decentralized
>> log messages (somewhat like StatusLogger in that regard).
>>
>> On 14 October 2015 at 21:51, Matt Sicker <bo...@gmail.com> wrote:
>>
>>> From what I can grok, it looks like a way to log map-like messages in a
>>> way that's specified by the new syslog standard. Basically, if you're not
>>> using RFC 5424, it does seem confusing.
>>>
>>> On 16 September 2015 at 10:45, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>>> What is the point of this class? It does so little... what am I missing?
>>>>
>>>> Some better Javadocs are required to justify its existence IMO.
>>>>
>>>> Gary
>>>>
>>>> --
>>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>>> Java Persistence with Hibernate, Second Edition
>>>> <http://www.manning.com/bauer3/>
>>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>>> Spring Batch in Action <http://www.manning.com/templier/>
>>>> Blog: http://garygregory.wordpress.com
>>>> Home: http://garygregory.com/
>>>> Tweet! http://twitter.com/GaryGregory
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>>
>>
>
>
> --
> [image: MagineTV]
>
> *Mikael Ståldal*
> Senior software developer
>
> *Magine TV*
> mikael.staldal@magine.com
> Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com
>
> Privileged and/or Confidential Information may be contained in this
> message. If you are not the addressee indicated in this message
> (or responsible for delivery of the message to such a person), you may not
> copy or deliver this message to anyone. In such case,
> you should destroy this message and kindly notify the sender by reply
> email.
>



-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: org.apache.logging.log4j.EventLogger

Posted by Mikael Ståldal <mi...@magine.com>.
I think this code is quite ugly:
StructuredDataMessage msg = new StructuredDataMessage(confirm, null,
"transfer");
msg.put("toAccount", toAccount);
msg.put("fromAccount", fromAccount);
msg.put("amount", amount);
EventLogger.logEvent(msg);

I would like to be able to do this in one statement.  Perhaps we can extend
MapMessage to use a build pattern so you can do something like this:
EventLogger.logEvent(
new StructuredDataMessage(confirm, null, "transfer")
.withValue("toAccount", toAccount)
.withValue("fromAccount", fromAccount)
.withValue("amount", amount)
);


On Thu, Oct 15, 2015 at 4:57 AM, Ralph Goers <ra...@dslextreme.com>
wrote:

> See http://logging.apache.org/log4j/2.x/manual/eventlogging.html. I used
> this as the basis for an audit logging system at my former employer. I have
> every intention of creating a log4j-audit subproject that mimics what was
> done there. I just need some PTO time to work on it….
>
> Ralph
>
>
>
> On Oct 14, 2015, at 7:52 PM, Matt Sicker <bo...@gmail.com> wrote:
>
> Wait, wait, I was missing an important aspect here. Event logging is a
> different concept than location-based logging. Think of it as decentralized
> log messages (somewhat like StatusLogger in that regard).
>
> On 14 October 2015 at 21:51, Matt Sicker <bo...@gmail.com> wrote:
>
>> From what I can grok, it looks like a way to log map-like messages in a
>> way that's specified by the new syslog standard. Basically, if you're not
>> using RFC 5424, it does seem confusing.
>>
>> On 16 September 2015 at 10:45, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>>> What is the point of this class? It does so little... what am I missing?
>>>
>>> Some better Javadocs are required to justify its existence IMO.
>>>
>>> Gary
>>>
>>> --
>>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>>> Java Persistence with Hibernate, Second Edition
>>> <http://www.manning.com/bauer3/>
>>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>>> Spring Batch in Action <http://www.manning.com/templier/>
>>> Blog: http://garygregory.wordpress.com
>>> Home: http://garygregory.com/
>>> Tweet! http://twitter.com/GaryGregory
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
>
>


-- 
[image: MagineTV]

*Mikael Ståldal*
Senior software developer

*Magine TV*
mikael.staldal@magine.com
Regeringsgatan 25  | 111 53 Stockholm, Sweden  |   www.magine.com

Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
email.

Re: org.apache.logging.log4j.EventLogger

Posted by Ralph Goers <ra...@dslextreme.com>.
See http://logging.apache.org/log4j/2.x/manual/eventlogging.html <http://logging.apache.org/log4j/2.x/manual/eventlogging.html>. I used this as the basis for an audit logging system at my former employer. I have every intention of creating a log4j-audit subproject that mimics what was done there. I just need some PTO time to work on it….

Ralph



> On Oct 14, 2015, at 7:52 PM, Matt Sicker <bo...@gmail.com> wrote:
> 
> Wait, wait, I was missing an important aspect here. Event logging is a different concept than location-based logging. Think of it as decentralized log messages (somewhat like StatusLogger in that regard).
> 
> On 14 October 2015 at 21:51, Matt Sicker <boards@gmail.com <ma...@gmail.com>> wrote:
> From what I can grok, it looks like a way to log map-like messages in a way that's specified by the new syslog standard. Basically, if you're not using RFC 5424, it does seem confusing.
> 
> On 16 September 2015 at 10:45, Gary Gregory <garydgregory@gmail.com <ma...@gmail.com>> wrote:
> What is the point of this class? It does so little... what am I missing?
> 
> Some better Javadocs are required to justify its existence IMO.
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com <ma...@gmail.com> | ggregory@apache.org  <ma...@apache.org>
> Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> 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>>


Re: org.apache.logging.log4j.EventLogger

Posted by Matt Sicker <bo...@gmail.com>.
Wait, wait, I was missing an important aspect here. Event logging is a
different concept than location-based logging. Think of it as decentralized
log messages (somewhat like StatusLogger in that regard).

On 14 October 2015 at 21:51, Matt Sicker <bo...@gmail.com> wrote:

> From what I can grok, it looks like a way to log map-like messages in a
> way that's specified by the new syslog standard. Basically, if you're not
> using RFC 5424, it does seem confusing.
>
> On 16 September 2015 at 10:45, Gary Gregory <ga...@gmail.com>
> wrote:
>
>> What is the point of this class? It does so little... what am I missing?
>>
>> Some better Javadocs are required to justify its existence IMO.
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>