The program logs the error log as something that seems to be of little use to the average user, but is very useful to program developers, and it can detect errors or unusual procedural signs. So what are the common ways to log error logs?
In most cases, the use of
1, directly recorded as Txt/xml file
2. Windows Event Log
Other ways to log error logs
1. Local queue of the current process
Without a simple and efficient persistence mechanism implementation, the efficiency of a single call is reduced
2. MSMQ
(1), non-in-process Message Queuing, single call speed, no process internal local queue fast
(2), built-in persistence mechanism, even down the machine, the information will not be lost
(3), can simply start a number of consumer programs to consume the queue elements, the scalability of strong
3. WCF services in a standalone process (interprocess pipelines)
(1), the persistence mechanism depends on the WCF service implementation way, needs to implement itself
(2), named pipe communication between processes on the local machine, faster than network traffic (e.g. Msmq,service broker, database)
4. WCF services in a standalone process (asynchronous invocation mode)
(1), unfortunately unable to use named pipes
(2), there is communication on the network, the speed is reduced
5. Database
Note: The log database cannot be merged with the business database, otherwise it will affect each other (high concurrency)
6. Service Broker for SQL Server
7. MongoDB (or similar NoSQL database)
(1), has the persistence mechanism
(2), fast
(3), if the recorded log needs to have a query function, this choice is best
(4), does not affect the performance of the business database
Asp. NET how error logs are logged