0

Is there a way to configure CallerLineNumber from config file in C#? I have gone through https://stackoverflow.com/a/46905798/5035500 and https://gist.github.com/litetex/b88fe0531e5acea82df1189643fb1f79 which are good examples but the configuration is in C# code.

amit jha
  • 398
  • 2
  • 6
  • 22

1 Answers1

3

CallerLineNumber is not something Serilog supports out-of-the-box... The examples you mentioned are all custom abstractions on top of Serilog.

If you want to control this behavior via config, you'll have to write your own custom code to read specific parameters from the config file and set up the Serilog pipeline accordingly.

C. Augusto Proiete
  • 24,684
  • 2
  • 63
  • 91
  • Then it's better to write in C# as mentioned in OP, if there is no config support by serilog... Thank you. – amit jha Oct 27 '20 at 09:34