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

AppSettings for DLL library #41

Open
5 tasks
DiskCrasher opened this issue Jul 29, 2019 · 2 comments
Open
5 tasks

AppSettings for DLL library #41

DiskCrasher opened this issue Jul 29, 2019 · 2 comments

Comments

@DiskCrasher
Copy link

A few questions before you begin:

Is this an issue related to the Serilog core project or one of the sinks or community projects. This issue list is intended for Serilog core issues. If this issue relates to a sink or related project, please log on the related repository. Please use Gitter chat and Stack Overflow for discussions and questons.

Does this issue relate to a new feature or an existing bug?

  • Bug
  • [ x ] New Feature

What version of Serilog is affected? Please list the related NuGet package.
SeriLog 2.8

What is the target framework and operating system? See target frameworks & net standard matrix.

  • netCore 2.0
  • netCore 1.0
  • [ x ] 4.7
  • 4.6.x
  • 4.5.x

Please describe the current behavior?
Currently SeriLog can read settings from an app.config or web.config file using AppSettings. However, for a DLL library there is no such file. The typical argument is that the calling app should control the settings. But if there are several calling apps using the same library this can become cumbersome very quickly.

Please describe the expected behavior?
There should be a way to set the logging behaviors (e.g. level) in an XML file for DLL libraries too. (Coming from log4net where this behavior is supported.)

If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem

@nblumhardt nblumhardt transferred this issue from serilog/serilog Jul 29, 2019
@nblumhardt
Copy link
Member

Thanks for the suggestion. It's not immediately clear that Serilog's model can accommodate this - some investigation of a possible API and scenarios is needed.

@ltoshea
Copy link

ltoshea commented Aug 4, 2019

This use case describes a similar scenario to how I intend to use it. DiskCrasher - I've actually loaded my settings from a 'serilog.config' file that I've setup that's just structured in the same format as an app.config. You can reference this in your dll.config. I'll try to remember tomorrow to post some snippets. (Remind me if I don't)

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