logging - Log4Net in Asp.Net Correct Implementation -
i trying implement log4net file appender in asp.net. have been successful implementing it. not sure correct architecture implement it.
i can add logger in each page , log information. however, thinking centralize logger class. may implement singleton pattern. wondering happen if request same page comes 2 different browsers. can implement thread static , every page instead of initializing own logger use centralize logger class log.
i suppose log4net file appender or rolling file appender using queue mechanism write log file. because 1 handle of file can acquired write file.
can me in regard. going right way or have issues down road when there tens , hundreds of requests coming different browsers.
i recommend not use singleton, instead use logger each controller , class want log from. loggers cheap create , cached log4net - , more if declare them static within class - , having 1 per class can change logging per class or namespace changing log4net configuration @ runtime - enable debug logging aid diagnosing problem in production, or turn down logging unexpectedly noisy. can without recycling app if have log config in separate file.
also if you're going use file logging, make sure use minimallock
Comments
Post a Comment