Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass in property/variables

Status
Not open for further replies.

osubb

Programmer
Jan 21, 2004
11
US
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



thanks,
osubb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top