5 ms·
Serilog – Simple .NET logging with fully-structured events
- Rapzid 10y agoI used Serilog on a project a couple years back and generally found it to be fantastic; wish the platforms I work with now had something as good. LogContext leads to some interesting strategies.
- insulanian 10y ago> wish the platforms I work with now had something as good. Which platforms are you working with now?
- taspeotis 10y agoThe author of Serilog (nblumhardt) has several other libraries. They're all well thought out and developed.
- abdullin 10y agoI second that. Nicholas himself is a very nice guy, pleasant to work with.
- scanr 10y agoWe're using serilog and seq together and they are fantastic.
- bobcostas55 10y agoSame here. The Seq interface could be improved a bit, but otherwise I'm very happy with that combo.
- DenisM 10y agoWhat about cross-platform logging? Serology looks amazing, but I need to be able to log from ASP.NET, iOS, and Jacascript, so that I get 360 view of my users as they hop from one medium to another. Serilog can scale without much effort with AWS Kinesis or AWS Dynamo. Now if only it was multi-platform...
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- alexatkeplar 10y agoYou might want to look at Snowplow (https://github.com/snowplow/snowplow https://github.com/snowplow/snowplow) - we have logging SDKs for .NET, Obj-C, JavaScript as well as many others, support Kinesis out the box and let you define JSON Schemas for all your event types. Disclosure, Snowplow co-founder.
- sakopov 10y agoSerilog is great. I use it together with LibLog [1] which is a fantastic library that allows you to swap between logging libraries by abstracting all of them and automatically discovering via reflection which one is being used. I used it to go from log4net to serilog a few months ago. [1] https://github.com/damianh/LibLog https://github.com/damianh/LibLog
- adontz 10y agoI never used serilog, so maybe I'm wrong, but looking at site docs and github sources I see very weak configuration file support compared to NLog or even log4net.
- nblumhardt 10y agohttps://github.com/serilog/serilog-settings-configuration https://github.com/serilog/serilog-settings-configuration (JSON) and https://github.com/serilog/serilog-settings-appsettings https://github.com/serilog/serilog-settings-appsettings (XML) should have pretty much everything covered - anything particular missing? Cheers!
- adontz 10y agoIf these https://github.com/serilog/serilog-settings-configuration/blob/dev/sample/Sample/appsettings.json https://github.com/serilog/serilog-settings-configuration/bl... https://github.com/serilog/serilog-settings-appsettings/blob/dev/test/Serilog.Settings.AppSettings.Tests/app.config https://github.com/serilog/serilog-settings-appsettings/blob... are more or less what can be done, than yes, comparing to NLog configuration possibilities Serilog is very weak. I do not position myself as NLog expert, but I had time to learn it and use in complex scenarios, so just opened NLog.config of one of my project and here is what I use. The following is not NLog vs Serilog comparison, it is very brief "what I use in NLog" vs "what I did not find in serilog by just viewing files in browser". So, I want everything to be configured from config file and changed after program is compiled. * Asynchronous wrapper for any log target with some parameters to tune if necessary. * Colorful output to console (separately to stdout and stderr). I can specify colors based on event properties using condition attribute. Using conditions applies to other log targets and other scenarios. * For file target I can specify various log archiving option, based on date, counter, rolling counter, etc. Paths can include references to special folders, process IDs, thread IDs, event event properties, etc., not only environment variables. * Did not find any concept of rules NLog has. I want to be able to freely map event parameters (name, level) to targets. Again, I have no experience with Serilog, so I expect myself to be wrong and least partially.
- mandeepj 10y agoI wish I could get the object data which caused the exception. None of these logging libraries provide that feature edit- for more info on what I mean: http://stackoverflow.com/questions/157911/in-a-net-exception-how-to-get-a-stacktrace-with-argument-values http://stackoverflow.com/questions/157911/in-a-net-exception... http://programmers.stackexchange.com/questions/278949/why-do-many-exception-messages-not-contain-useful-details http://programmers.stackexchange.com/questions/278949/why-do... edit 2- I just read little bit more on this. Creating a memory dump of your process is one way to go - https://msdn.microsoft.com/en-us/library/d5zhxt22.aspx#BKMK_Open_a_dump_file https://msdn.microsoft.com/en-us/library/d5zhxt22.aspx#BKMK_...
- bunderbunder 10y agoIf you're OK with using an IoC container, using Windsor or PostSharp like the first answer to your first link suggests does do the trick. I'm of two minds about whether it's a good idea to do this, though. I have done it once in the past, out of frustration at trying to support a particularly failure-prone application, and can confirm it was a useful thing to do at the time. I haven't done it since, though, and eventually ripped it back out once I got the app wrestled back to a happy place. The problem is, it lets you get away with not thinking very hard about your application's failure modes. So my sense was that, over the long run, the cure is worse than the disease.
- mandeepj 10y agoYou have a point. I think in a large app let's say 50+ screens and 100+ db tables, it will take quite a bit of time before we stablize it until then we are at the mercy of good logging and debugging tools.
- bronthulke 10y agoI use Serilog on a number of projects and find it very simple and extensible. I wrote a quick article on using it in ASP.NET Core here, if your interested: http://blog.angelwebdesigns.com.au/structured-logging-with-serilog-in-asp-net-core/ http://blog.angelwebdesigns.com.au/structured-logging-with-s...