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

Default IEasyNetQLogger performances #385

Closed
mleenhardt opened this issue Feb 22, 2015 · 8 comments
Closed

Default IEasyNetQLogger performances #385

mleenhardt opened this issue Feb 22, 2015 · 8 comments

Comments

@mleenhardt
Copy link
Contributor

Looking at this thread, it looks like the default IEasyNetQLogger ConsoleLogger can be a bottleneck.

I'm guessing people may not pay attention to the fact that a custom implementation can be specified and will just often stick with the default.

Looking at the current implementation, I think it could use some improvements like:

  • Queue all write in a concurrent collection and Console.WriteLine from a background thread.
  • Define additional *Write methods that take one, two and three object parameters (the same way String.Format and Console.WriteLine do) to avoid the slight overhead of using params object[] when we don't have to.
  • ...
@Pliner
Copy link
Member

Pliner commented Feb 23, 2015

@mleenhardt

  1. In my opinion, we shouldn't tune logging because where are a lot of libraries that do it nice. I think turning off logging by default(use NoopLogger) or just stay as is are reasonable options.
  2. Sounds very good.
  3. Should we create separare packages for log4net and nlog to implement IEasyNetQLogger properly?

@mikehadlow @micdenny what do you think?

@mleenhardt
Copy link
Contributor Author

I didn't consider it but disabling logging by default and letting it be 'opt-in' indeed sounds like a good option. A bunch of framework do it that way, e.g. EF where you specify an Action<string> to enable logging.

I agree that there are already a bunch of great logging frameworks out there, we probably shouldn't be reinventing the wheel.

@mikehadlow
Copy link
Contributor

I'm happy to have no logging by default out-of-the-box. We already
encourage people to replace the console logger with something better suited.

On Mon, Feb 23, 2015 at 8:51 AM, Mathieu Leenhardt <notifications@github.com

wrote:

I didn't consider it but disabling logging by default and letting it be
'opt-in' indeed sounds like a good option. A bunch of framework do it that
way, e.g. EF where you specify an Action to enable logging.

I agree that there are already a bunch of great logging frameworks out
there, we probably shouldn't be reinventing the wheel.


Reply to this email directly or view it on GitHub
#385 (comment).

@Pliner
Copy link
Member

Pliner commented Feb 23, 2015

@mikehadlow What do you think about creating nuget packages for log4net and nlog?
For example, in topshelf it's very easy to start logging using log4net: install nuget package and register new logger via simple UseLog4Net call on host configuration. In our case every user has to implement IEasyNetQLogger interface.

@mikehadlow
Copy link
Contributor

I think that'd be a great idea.

@Pliner
Copy link
Member

Pliner commented Feb 25, 2015

@mikehadlow nice. will do pull request soon :)

@mleenhardt
Copy link
Contributor Author

The no logging by default part was done in #391.

I also need to update the wiki page accordingly.

@mleenhardt
Copy link
Contributor Author

Wiki updated.

@Pliner Pliner closed this as completed May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants