简体   繁体   English

如何使用ASP.NET会话和log4net基于登录的用户创建日志文件

[英]How to create a log file based on logged in user using ASP.NET session and log4net

I'm not sure this is a valid way of asking this question. 我不确定这是问这个问题的有效方法。 I implemented logging using log4net, I was able to create a log file, and can look for the information in log file. 我使用log4net实现了日志记录,能够创建日志文件,并且可以在日志文件中查找信息。 So far I didn't implement the user profiles, I was asked to create log files based on the user with the format of [AID_YYYYMMDD]. 到目前为止,我还没有实现用户配置文件,要求我根据用户创建日志文件,格式为[AID_YYYYMMDD]。 Please someone suggest me the best way to learn log4net and implement the user profile based file name. 请有人建议我学习log4net并实现基于用户配置文件的文件名的最佳方法。

Log4Net has aspnet-request to get the Current User. Log4Net具有aspnet请求来获取当前用户。 You will need to format the way you want it. 您将需要格式化所需的格式。

%aspnet-request{AUTH_USER}

Documentation 文献资料

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM