Log4net - want to create a log file for each user of the web application

We use log4net (replacing nLog) in our Asp.Net web application. NLog had a useful feature that would allow us to create a log file for each user - which is useful for organizing and searching for log statements.

Does anyone have any ideas on how to do this with log4net?

+3
source share
4 answers

Instead of logging into a file, consider logging into a database table and specify the user ID that is logged. Thus, you can make selections against the table based on the user (or users) and see only their data. It is probably also necessary to register a session identifier in order to facilitate session-based queries.

+7
source

One way is to write your own appender derived from RollingFileAppender

+1
source

RollingFileAppender session_start global.asax. , , [ ] myapp.log, . , , -:)

0

I simply log into a single file and then use a log viewer like LogExpert to filter by username, etc. when I want to see a specific user session.

enter image description here

0
source

All Articles