Live data from Hacker News

Serilog – Simple .NET logging with fully-structured events

serilog.net

11–20 of 20 posts

Re: Serilog – Simple .NET logging with fully-structured events

#12
post #8

What 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]

Re: Serilog – Simple .NET logging with fully-structured events

#13
I 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...

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_...

Re: Serilog – Simple .NET logging with fully-structured events

#14
post #8

What 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...

You might want to look at 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.

Re: Serilog – Simple .NET logging with fully-structured events

#15
post #11

I 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.

https://github.com/serilog/serilog-settings-configuration (JSON) and https://github.com/serilog/serilog-settings-appsettings (XML) should have pretty much everything covered - anything particular missing? Cheers!

Re: Serilog – Simple .NET logging with fully-structured events

#16

I 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... 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/libr…

If 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.

Re: Serilog – Simple .NET logging with fully-structured events

#18

I 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... 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/libr…

If 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 event…

You 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.

Re: Serilog – Simple .NET logging with fully-structured events

#19
post #11

I 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.

https://github.com/serilog/serilog-settings-configuration (JSON) and https://github.com/serilog/serilog-settings-appsettings (XML) should have pretty much everything covered - anything particular missing? Cheers!

If these https://github.com/serilog/serilog-settings-configuration/bl... 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.

Re: Serilog – Simple .NET logging with fully-structured events

#20
post #19

Earlier quoted context omitted.

https://github.com/serilog/serilog-settings-configuration (JSON) and https://github.com/serilog/serilog-settings-appsettings (XML) should have pretty much everything covered - anything particular missing? Cheers!

If these https://github.com/serilog/serilog-settings-configuration/bl... 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.…

Thanks for the reply! NLog's configuration story is certainly impressive; I think the differences in approach make them hard to compare directly on some of these however (for example, most sinks based on network I/O do asynchronous batching by default in Serilog).

Just on the topic of console output, you might enjoy the "literate console" - https://nblumhardt.com/2015/06/contender-for-nets-prettiest-... - for a different take on colored console output :-)

Cheers!

Post reply on HN