question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST]: Allow injection of custom LoggerService

See original GitHub issue

It’s not possible to redirect all logging to the applications own logging pipeline currently as both LoggerServiceFactory and ILoggerService are internal.

I would like to inject my own logging service (either seq or Application Insights depending on environment) and have all logs consolidated.

It seems log4net is suppoerted via config file however I have other correlation information that I need to add which I cannot see how to accomplish.

Is this possible or is there another way to achieve this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
imback82commented, Jun 12, 2020

Would it be possible to replace log4net with a more modern and maintained logging framework (serilog maybe)?

serilog should be good. Do you want to work on this? If so, I can break down work items for you. Thanks!

1reaction
imback82commented, Apr 3, 2020

We could expose LoggerServiceFactory and ILoggerService as public, but let me double-confirm. Meanwhile, you can use https://github.com/aelij/IgnoresAccessChecksToGenerator to access internal classes if you are blocked.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Logger service not working as expected · Issue #507
We need to use our custom injectable logger. Environment. Nest version: 4.6.5 For Tooling issues: - Node version: v8.10.0 - Platform: Linux ...
Read more >
Logger | NestJS - A progressive Node.js framework
To enable dependency injection for your custom logger, create a class that implements LoggerService and register that class as a provider in ...
Read more >
c# - Dependency injection and named loggers
I'm using Ninject to resolve the current class name for the logger instance like this: kernel.Bind<ILogger>().To<NLogLogger>() .
Read more >
NestJS Custom Logger With RabbitMQ Injection
To enable dependency injection for my custom logger, I created a class that implements LoggerService and registered that class as a provider in...
Read more >
How to Use NestJS Logger
It is possible to customize it but at that point let's just import it as is. You can import the logger service with:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found