logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Xuguang" <Xuguang.C...@cn.fid-intl.com>
Subject Can I use static logger and ThreadContext.Properties in asp.net p roject?
Date Thu, 20 Sep 2007 03:11:27 GMT

	Dear all:

	   I am trying to write a log wrap class in asp.net project.
	   I want to use a static logger ,such as public static ILog log =
LogManager.GetLogger("XXXX");
	    Then I want to use log4net.ThreadContext.Properties[Key] to set
custom fields. Such as "username".
	    But now, I am't sure if the log is safe in asp.net model?
	    For example, user A login website and set
log4net.ThreadContext.Properties["username"] = "User A",
	    then user B login website on another pc  and set
log4net.ThreadContext.Properties["username"] = "User B",
	    Now, if user A write a log, what the username is?

	    On my local pc, I run two IE, it seems to be "UserB". In other
word, it was modified by another IE application.
	    According to log4net.ThreadContext document, it should work
well.
	    But I am not sure if it caused by VS2005 test envirement....
	 
	    Thanks

	    Napo , 	


Best Regards,



Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message