serilog-archive / serilog-sinks-loggly

A Serilog event sink that writes to Loggly
Apache License 2.0
27 stars 30 forks source link

The Loggly sink automatically change the LogLevel when the LogLevelSwitching is active. #32

Open moattarwork opened 6 years ago

moattarwork commented 6 years ago

The Loggly sink automatically change the LogLevelSwich to the debug. It should be updated from Loggly and if the feature is not possible it shouldn't change the value at all.

Here is the related code from HttpLogShipper


        async Task OnTick()
        {
            LogEventLevel? minimumAcceptedLevel = LogEventLevel.Debug;

            try
            {
              ...........
            }
            catch (Exception ex)
            {
                SelfLog.WriteLine("Exception while emitting periodic batch from {0}: {1}", this, ex);
                _connectionSchedule.MarkFailure();
            }
            finally
            {
                lock (_stateLock)
                {
                    _controlledSwitch.Update(minimumAcceptedLevel);

                    if (!_unloading)
                        SetTimer();
                }
            }
        }
MiguelAlho commented 6 years ago

Thanks. This code was originally in the Seq Sink and has changed (https://github.com/serilog/serilog-sinks-seq/commit/9a2a8d5f7452b39193be36ed3c3a7752801d135d).

I'll look into it.