log4net的 - 要创建的每个Web应用程序的用户的日志文件 [英] log4net - want to create a log file per web application user
问题描述
我们在我们的Asp.Net Web应用程序使用log4net的(取代n日志)。 n日志有一个有用的功能,使我们能够为每个用户创建一个日志文件 - 这是组织和查找日志语句有益
We are using log4net (replacing nLog) in our Asp.Net web application. nLog had a useful feature that would allow us to create a log file per user - which is helpful for organizing and locating the log statements.
有没有人对如何做到这一点任何想法与log4net的?
Does anyone have any ideas on how to do this with log4net?
推荐答案
而不是记录到一个文件,想想记录到数据库表中,并有记录数据的用户ID的一部分。这样,您就可以做对选择基于用户(或用户)的表,只看到他们的数据。大概也是要记录的会话ID,也使基于会话查询方便。
Instead of logging to a file, think about logging to a database table and have the user id part of the logged data. This way you can do selects against the table based on the user (or users) and see only their data. Probably also want to log the session id, too, to make session based queries easy.
这篇关于log4net的 - 要创建的每个Web应用程序的用户的日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!