Hangfire.Console icon indicating copy to clipboard operation
Hangfire.Console copied to clipboard

To big console, can I clear it?

Open senzacionale opened this issue 5 years ago • 1 comments

We are using your Hangfire.Console with .net core and Docker and works without any problem. Only problem we have is that we are logging 30k of rows because job is talking 3h and is impossible to open conole log.

Is it possible to clear log or show only last 1000 rows?

senzacionale avatar Jan 28 '19 08:01 senzacionale

No, this is currently impossible. Console was not designed to be a logger, but rather a way to track job status/progress, so I'd suggest writing only the essential stuff.

There are some technical limitations on trimming data to the last N rows (e.g. Hangfire storage API doesn't support range deletes for Sets), so you can only purge the entire Console. It is not implemented though.

It seems doable to limit the initial output to last N lines, but there's a few things to consider here, e.g. what to do with progress bars, or how to indicate there's some truncated data etc.

pieceofsummer avatar Jan 29 '19 00:01 pieceofsummer