Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimumLogLevel problem #16

Open
ZedZipDev opened this issue Jan 31, 2025 · 1 comment
Open

minimumLogLevel problem #16

ZedZipDev opened this issue Jan 31, 2025 · 1 comment

Comments

@ZedZipDev
Copy link

I create the logger

  Log.Logger = new LoggerConfiguration()
  .WriteTo.RichTextBox(
  richTextBoxControl: richTextBox1,
  minimumLogEventLevel: LogEventLevel.Verbose,
  outputTemplate: outputTemplate,//"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
  theme: ThemePresets.Dark,
  messageBatchSize: 100,
  messagePendingInterval: 10,
  autoScroll: true,
  maxLogLines: 1000)
  .CreateLogger();

It works fine but I see INF log records only.
What I have set wrong?
How to set the level to see all log records?
Thanx.

@vonhoff
Copy link
Owner

vonhoff commented Feb 8, 2025

I'm not sure why that happens, I haven't found a solution yet. However, I got it to work with the following workaround:

Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Verbose()
    .WriteTo.RichTextBox(
        richTextBoxControl: richTextBox1,
        outputTemplate: outputTemplate, //"[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}",
        theme: ThemePresets.Dark,
        messageBatchSize: 100,
        messagePendingInterval: 10,
        autoScroll: true,
        maxLogLines: 1000)
    .CreateLogger();

Basically adding:

 .MinimumLevel.Verbose()

If you (or anyone else reading this) finds a better solution, please let me know. I don't have much time to dig into this right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants