Seq Documentation and Support

Welcome to the Seq documentation hub. You'll find comprehensive guides and documentation to help you start working with Seq as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Ask A Question

Questions

3

Dynamic Logging Levels + Web.config transformations -- is this approach correct?

Hi all, My goal is to: * Have a base Serilog config (Web.config) which uses no API key and has a debug level of information. * Have transforms (e.g. Web.Stage.config) which may / may not supply & API key, and which defer to Seq on logging levels (but also supply a default in the config). My current base `Web.config` reads: ``` <!-- Serilog / Seq Logging Configuration --> <add key="serilog:minimum-level" value="Debug" /> <!-- Logging Levels: Verbose, Debug, Information, Warning, Error --> <add key="serilog:using:Seq" value="Serilog.Sinks.Seq" /> <add key="serilog:write-to:Seq.serverUrl" value="http://localhost:5341" /> <add key="serilog:write-to:Seq.apiKey" value="" /> ``` My example test transformation includes the API key & server (redacted): ``` <add key="serilog:minimum-level" value="Information" xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" /> <add key="serilog:write-to:Seq.serverUrl" value="http://[Redacted]:5341" xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" /> <add key="serilog:write-to:Seq.apiKey" value="[Redacted]" xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" /> ``` In an Autofac module, I have: ``` private ILogger WireUpSerilog() { var levelSwitch = new LoggingLevelSwitch(); var envName = ConfigurationManager.AppSettings["Environment"]; var logger = new LoggerConfiguration() .ReadFrom.AppSettings() .MinimumLevel.ControlledBy(levelSwitch) .Enrich.WithProperty("Environment", envName) .Enrich.WithEnvironmentUserName() .Enrich.WithMachineName() .CreateLogger(); Log.Logger = logger; return logger; } ``` which is then wired up as: ``` builder.Register(c => WireUpSerilog()).As<ILogger>().InstancePerLifetimeScope(); ``` Is this sufficient to enable dynamic logging levels via API keys? Or is there anything I'm missing here? Do I need to specify the use of LoggingLevelSwitch in the config itself? Just making sure.

Posted by Sean Killeen 3 years ago

8

Autofac.Core.DependencyResolutionException on startup

Hi, I'm running Seq on docker and recently getting an exception on startup. Any ideas? Here are the logs: ──────────────────────────────────────── Seq ♦ Machine data, for humans. ─────────── © 2019 Datalust Pty Ltd ──── Running as server; press Ctrl+C to exit. [18:15:16 INF] Seq "5.1.3118" running on OS "Linux 4.15.0-1055-azure #60-Ubuntu SMP Thu Aug 8 18:29:07 UTC 2019" [18:15:18 INF] Seq listening on ["http://localhost/", "http://localhost:5341/"] [18:15:18 INF] Seq using canonical URI "https://***/" [18:15:18 INF] Opening document store "/data/Documents/documents.lmdb" thread '<unnamed>' panicked at 'assertion failed: self.remaining() >= dst.len()', /rust/cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.4.12/src/buf/buf.rs:242:9note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. [18:15:19 INF] Closing document store [18:15:19 ERR] Uncaught exception from worker "Start background processes" ("e9498c73-d8e8-40c5-b7c4-a95f7a1fb282") Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = TelemetryController (ReflectionActivator), Services = [Seq.Server.Features.Telemetry.TelemetryController], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = SystemSettings (ReflectionActivator), Services = [Seq.Server.Features.Settings.SystemSettings], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IDocumentStore (DelegateActivator), Services = [Quince.IDocumentStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = StorageSubsystem (DelegateActivator), Services = [Seq.Server.Storage.StorageSubsystem], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Flare native storage failed (InternalError), internal panic with 'assertion failed: self.remaining() >= dst.len()' (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = SystemSettings (ReflectionActivator), Services = [Seq.Server.Features.Settings.SystemSettings], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IDocumentStore (DelegateActivator), Services = [Quince.IDocumentStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = StorageSubsystem (DelegateActivator), Services = [Seq.Server.Storage.StorageSubsystem], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Flare native storage failed (InternalError), internal panic with 'assertion failed: self.remaining() >= dst.len()' (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IDocumentStore (DelegateActivator), Services = [Quince.IDocumentStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = ExternallyOwned ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = StorageSubsystem (DelegateActivator), Services = [Seq.Server.Storage.StorageSubsystem], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Flare native storage failed (InternalError), internal panic with 'assertion failed: self.remaining() >= dst.len()' (See inner exception for details.) (See inner exception for details.) ---> Autofac.Core.DependencyResolutionException: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = StorageSubsystem (DelegateActivator), Services = [Seq.Server.Storage.StorageSubsystem], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Flare native storage failed (InternalError), internal panic with 'assertion failed: self.remaining() >= dst.len()' (See inner exception for details.) ---> System.Exception: Flare native storage failed (InternalError), internal panic with 'assertion failed: self.remaining() >= dst.len()' at Flare.Storage.Native.FlareResult.EnsureSuccess() at Flare.Storage.Store.Open(String path) at Flare.Storage.Native.FlareStorageExtent.OpenStore() at Flare.Storage.Native.FlareStorageExtent..ctor(IStorageEngine storageEngine, ExtentRange range, String dataFile) at Flare.Storage.Native.FlareStorageEngine.CreateExtent(ExtentRange range, String dataFile, String instanceName) at Flare.Storage.Extents.ExtentMap..ctor(IStorageEngine[] storageEngines, String extentsPath) at Flare.Events.EventStore..ctor(IStorageEngine[] storageEngines, String extentsPath, WorkerPool workerPool, MemoryThresholds memoryThresholds, BroadcastChannel broadcast, IClock clock) at Seq.Server.SeqServerModule.InitStorageSubsystem(IComponentContext c) at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable`1 parameters) at Seq.Server.SeqServerModule.<>c.<Load>b__14_10(IComponentContext c) at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_0`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p) at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) --- End of inner exception stack trace --- at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters, Object& decoratorTarget) at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters) at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters) at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass5_1`1.<CreateLazyRegistration>b__1() at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy`1.CreateValue() at Seq.Server.ServiceProcess.ServerService.<Start>b__13_0(CancellationToken cancel) at Flare.Workers.WorkerPool.<>c__DisplayClass4_0.<Run>g__DoWork|0()

Posted by Yohan Belval about a year ago