Loading...

log4j-user@logging.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: log4j - optional parameter Scott Deboy Tue Jan 31 19:10:53 2012

The feedback usually given is to use a different Logger named 'encryption'
and manage its logging threshold in the configuration file, so you can
control encryption logging separately from the other logger you are using
in this class.

On Wed, Jan 4, 2012 at 10:47 PM, lavsara <[EMAIL PROTECTED]> wrote:

>
> Hi,
> I need to add an optional parameter say "Encryption=true" to the
> consoleappender in log4j.properties file
> and in the Business class I need to check something like
>
> if  (encryption)
> {
> logger.debug(encrypt(message)); //encrypt() has the encryption logic.
> }
>
> I guess I have to extend consoleappender and have a getter/setter for
> encryption property.
> Is this a good approach? Or is there any other optimal way of acheiving
> this?
>
> Thanks,
> lavsara
> --
> View this message in context:
> http://old.nabble.com/log4j---optional-parameter-tp33084256p33084256.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>