I am new to serilog and I plan to use it in production environment, so is there any performance issue to send all Log levels (Info, warning, errors, etc..) over HTTPs to a web api that I have created and this api will just write logs to file as I don't want to write log files on the production server for security issues unless there is an out of the box way to encrypt them?
As with everything, it depends. You have to define your requirements for logging and for performance before you can answer your own question.
Examples:
These answers will help you decide how you're going to configure your Serilog logging pipeline and which Sinks to use (or even develop).
Check the configuration options available in the sinks you're planning to use (e.g. batchPostingLimit
, period
, queueLimit
if you're using Serilog.Sinks.Http
), and take a look at the Serilog.Sinks.Async
which allows you to delegate the logging to a background thread if your sink doesn't implement that out-of-the-box.
As for performance, you'll have to measure it and decide what's acceptable for your application.