I don't believe this will work. The system properties are set once the
Servlet is started. I will have different parameters for each new
connection (thread) of the servlet. I need a way to alter the values for
each thread. I thought of using MDC, but that only worked when using the
"ConversionPatter" or using the "sql" param for JDBCAppender.
Is there any way to pass in values to log4j for each client connection
(Servlet thread)??
thanks,
osubb
James A. N. Stauffer wrote:
>
> In an XML config, system properties can be used like ${catalina.base}.
>
> On Wed, Feb 13, 2008 at 5:23 PM, osubb <[EMAIL PROTECTED]> wrote:
>>
>> I am pretty new to log4j and have a question that should be easy. I am
>> using
>> log4j in a web (java servlets) environment.
>>
>> 1) How do I pass in variables? I have an app that uses the
>> JDBCAppender
>> and would like to pass in the connection values. Is there an easy way
>> to do
>> this? These values could be different for each client that access the
>> Servlet(s). Is there a pattern for this type of scenario?
>>
>> At this point, I have to hardcode the URL, user, and password values in
>> the
>> log4j.xml file. I tried using MDC, but this seems to work in the
>> "ConversionPattern" param for log files and the "sql" param name for the
>> JDBCAppender. It does not work for the "URL", "user", and "password"
>> param
>> values (does not change to MDC value).
>>
>> Any help would be appreciated,
>> osubb
>> --
>> View this message in context:
>> http://www.nabble.com/dynamic-variables-parameters-tp15470530p15470530.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]
>>
>>
>
>
>
> --
> James A. N. Stauffer http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/dynamic-variables-parameters-tp15470530p15481252.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]