logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Patel <rakesh.mailgro...@gmail.com>
Subject Re: Advice on auditing actions
Date Sun, 19 Mar 2006 22:19:05 GMT
can you give an example of how the xml config file would look? Are you 
saying there's some regular expression i can take advantage of to attach 
the appropriate appender to the audit loggers?

Thanks

Rakesh

James Stauffer wrote:

>Attach one appender to the audit logger and a different category to
>the other logger (com?)
>
>On 3/17/06, Rakesh Patel <rakesh.mailgroups@gmail.com> wrote:
>  
>
>>so i have another logger but how do i control loggers output to a
>>specific appender?
>>
>>cheers
>>
>>Rakesh
>>
>>James Stauffer wrote:
>>
>>    
>>
>>>Do it like the following.  Then it will be easy to send the audit logs
>>>to another location.
>>>
>>>final static Logger _logger = Logger.getLogger(ReferenceDataDaoImpl.class);
>>>final static Logger _auditor =
>>>Logger.getLogger("audit."ReferenceDataDaoImpl.class.getName());
>>>
>>>
>>>On 3/17/06, Rakesh Patel <rakesh.mailgroups@gmail.com> wrote:
>>>
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>i have a requirement to audit events to a database table. I thought of
>>>>using the log4j JdbcAppender to do this but the issue i have is there's
>>>>auditing and there's debugging.
>>>>
>>>>For example,
>>>>
>>>>logger.debug("Value of variable is now:{}",aVariable); // this is not
>>>>needed for auditing
>>>>logger.debug("Successful logon for username:{}",userName); // this
>>>>should end up in the audit table
>>>>
>>>>My current configuration of log4j is to declare a class-specific logger
>>>>in each class that needs logging:
>>>>
>>>>final static Logger _logger = Logger.getLogger(ReferenceDataDaoImpl.class);
>>>>
>>>>I could use this logger and utilise thresholds and have audit events
>>>>triggered by calling logger.error() but that does not seem a very clean
>>>>approach.
>>>>
>>>>Another idea is to declare an additional logger to be used for auditing:
>>>>
>>>>final static Logger _logger = Logger.getLogger(ReferenceDataDaoImpl.class);
>>>>final static Logger _auditor = Logger.getLogger(ReferenceDataDaoImpl.class);
>>>>
>>>>and have that logger use JdbcAppender. Or maybe one global logger for
>>>>auditing?
>>>>
>>>>What do you guys think?
>>>>
>>>>Cheers
>>>>
>>>>Rakesh
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>--
>>>James Stauffer
>>>Are you good? Take the test at http://www.livingwaters.com/good/
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>>    
>>
>
>
>--
>James Stauffer
>Are you good? Take the test at http://www.livingwaters.com/good/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message