Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging #6

Open
darkl opened this issue May 4, 2013 · 19 comments
Open

Logging #6

darkl opened this issue May 4, 2013 · 19 comments

Comments

@darkl
Copy link
Member

darkl commented May 4, 2013

There should be logs in the framework.

A logging framework (such as log4net) should be considered.

@darkl darkl added this to the Wamp v1.2.2.* milestone Mar 20, 2015
@darkl
Copy link
Member Author

darkl commented Mar 20, 2015

Being developed on logs branch using Castle ILogger interface. An interesting option is to use LibLog.

Please comment here about specific logs you would like to have from the library.

@shanielh
Copy link

Use LibLog 👍

@fconrady
Copy link

In the case of Autobahn's Python, JavaScript and C++ clients I found the debug flag helpful. Something similar may be good for WampSharp, for example, being able to see the JSON that was serialized or deserialized.

@darkl
Copy link
Member Author

darkl commented May 15, 2015

Yeah, the serialized json is actually written to logs in the develop branch. You are welcome to try it via MyGet feed and add other suggestions.

@BrannonKing
Copy link

If you want to expose some Monitor event for logging, that might be handy. Trace calls (System.Diagnostics) would also work, but I generally prefer them less. I would not integrate some 3rd-party logging solution. Leave that to the application-level integration so that they can chose the right logging library for the application -- it's not a framework thing.

@RichiCoder1
Copy link

@darkl I actually ran into a perf issue because I was sending not-small json messages over Wamp and the sync logging was waiting to write out massive strings before continueing. I switched the logger to async, but I was wondering if was possible to either A) only write messages on a parse failure or B) but message writing behind it's own flag completely.

@darkl
Copy link
Member Author

darkl commented Dec 14, 2016 via email

@RichiCoder1
Copy link

There's no way to it specifically though, since it pulls the logger effectively out of thin error w/ LibLog. So I'd have to set the context of my whole application to something higher than debug.

@darkl
Copy link
Member Author

darkl commented Dec 14, 2016 via email

@darkl
Copy link
Member Author

darkl commented Dec 14, 2016 via email

@RichiCoder1
Copy link

I utilize Serilog, but the issue is I'd like to keep the log level set to Debug and have Json messages not automatically be written, even at Debug level.

@darkl
Copy link
Member Author

darkl commented Dec 14, 2016 via email

@RichiCoder1
Copy link

Apparently Serilog added a source context minium level override a few months back, so my point is indeed moot. Sorry about that.

@darkl
Copy link
Member Author

darkl commented Dec 14, 2016

Great!

@llehn
Copy link

llehn commented Aug 4, 2017

LibLogs perf is catastrophic, at least when used with Serilog. Its spending 90% of time in reflection (resharper profiling tells that), compiling lambdas. LibLog may be an ok case for applications, but with current lack of perf a no-go for libraries/frameworks.

@llehn
Copy link

llehn commented Aug 4, 2017

LibLog has absolutely horrifying performance. It should not be used in a library/framework at all. My simple loop publishing a message to a web client eats loads of CPU managing only 1000 messages/sek. All with loglevel disabled to minimum. All time is spent in LibLog which calls reflection and Expression.Compile() on every published message.

@darkl
Copy link
Member Author

darkl commented Aug 4, 2017

LibLog is designed for libraries. The only places in the code where .Compile() is called (at least for the Serilog provider) is in static context (i.e. static constructor or the SerilogLogProvider constructor which happens once). This should be ok for most cases.

@darkl
Copy link
Member Author

darkl commented Aug 4, 2017

I also just submitted a pull request which fixes all Expression.Compile per instance/per message calls to static calls. This should resolve all such issues if they exist.

@llehn
Copy link

llehn commented Aug 4, 2017

Thank you! I just tried your changes with WampSharp - throughput went from 1200 messages/sek to 13000 messages/sek. So the issue did exist.
I'll do a PR to this repo using the code from your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants