logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: How to log to a regular file without using levels (warn, info, etc) ?
Date Mon, 04 Aug 2014 15:44:01 GMT
Yes.  Use a Marker on your Audit events and then add a global filter that accepts events with
those Markers.

Ralph

On Aug 4, 2014, at 8:00 AM, Matt Sicker <boards@gmail.com> wrote:

> Take a look at the EventLogger:
> 
> http://logging.apache.org/log4j/2.x/manual/eventlogging.html
> 
> Javadocs:
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/EventLogger.html
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/message/StructuredDataMessage.html
> http://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/ThreadContext.html
> 
> 
> On 4 August 2014 09:08, Rebecca Ahlvarsson <rahlvarsson@gmail.com> wrote:
> I am interested in using log4j for audit logging, in other words, I will open my own
file and start logging anything I want. Therefore I do NOT want to use warn, info or any log
level. Something like that:
> 
> Log log = new Log("blah.txt");
> log.log("Test");
> log.close();
> 
> How can I do that with LOG4J?
> 
> A concrete example that I can run will be very appreciated.
> 
> Thanks,
> 
> Rebecca Ahlvarsson
> 
> 
> 
> 
> -- 
> Matt Sicker <boards@gmail.com>


Mime
View raw message