This repository has been archived by the owner. It is now read-only.

ELM logs disappears. Can we persist it to a file or DB? #328

valcs007 opened this Issue Aug 11, 2016 · 2 comments


None yet
3 participants
Copy link

valcs007 commented Aug 11, 2016

Since ELMAH framework is not supported for ASP.Net Core, i started using ELM prototype capturing unhandled Exceptions as well as logging.


services.AddElm(options => {
            options.Path = new PathString("/elm");
            options.Filter = (name, level) => level >= LogLevel.Information;

app.UseElmPage(); // Shows the logs at the specified path
app.UseElmCapture(); // Adds the ElmLoggerProvider

It allows me to view /ELM page where it shows all my logs but it disappears from my webserver after sometime. Where is this currently stored? Do we have a way to persist this in a file or to DB?

If you have any other suggestion, please let us know. We want to capture exceptions from PROD.



This comment has been minimized.

Copy link

pranavkm commented Aug 11, 2016

An alternative to messing with ELM would be to look at using Serilog or NLog to provide the serialization. You might have to use ExceptionHandler to capture and log unhandled exceptions.

ELM's storage container ElmStore is registered in the service collection, so you should have access to recorded events via DI. However you would have to come up with the infrastructure to figure out when and how to serialize this data.


This comment has been minimized.

Copy link

Eilon commented Aug 12, 2016

Right, ELM is not (currently) designed to save logs across the application restarting. For that purpose we recommend using any of the great, fully-featured logging systems out there that support storing logs to a file/database/remote store, and then use a log viewer to see what's up in those logs.

@Eilon Eilon added the enhancement label Aug 12, 2016

@Eilon Eilon added this to the Backlog milestone Aug 12, 2016

@Eilon Eilon added the ELM label Dec 20, 2016

@Eilon Eilon added the wontfix label May 11, 2017

@Eilon Eilon closed this May 11, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.