question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate logging

See original GitHub issue

Steps to reproduce

configure the db context options with logging

.LogTo(Console.WriteLine, LogLevel.Information)

The issue

Every message is logged to the console twice. Once in color, once in black and white

image

Further technical details

MySQL version: 5.7.19 Operating system: windows 10 Pomelo.EntityFrameworkCore.MySql version: 6.0.1 Microsoft.AspNetCore.App version: 6.0.5

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mandar1jncommented, May 23, 2022

yup. Even without the logto there is already an instance logged to the console. It’s my configuration. Thank you for your time

0reactions
lauxjpncommented, May 21, 2022

@mandar1jn This is going to be an issue somewhere in your app configuration code.

Have you tried it without the LogTo() shortcut? ASP.NET Core might just already have setup the logging for you and LogTo() is then issuing a second logging call. For example, you might already have setup the logging via your appsettings.json file.

(In case you want me to, I can try to replicate this in an ASP.NET app.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Duplicate log output when using Python logging module
The problem is that every time you call myLogger() , it's adding another handler to the instance, which causes the duplicate logs.
Read more >
Duplicate Logging Messages in Python
For example, we can get another logger by using another_logger = logging.getLogger('main') . In this way, logging message from my_logger have no ...
Read more >
Duplicate logs - Elasticsearch
I'm facing duplicate logs only in my QA ELK servers.. I have Prod ELK server with exact same configuration but I'm not facing...
Read more >
Duplicate logging of event logs
When you configure duplicate logging, the duplicates are kept on the file server, and the primary event logs are stored on the first...
Read more >
Why python logger's logs are sometimes duplicated and ...
Sometimes, you may face an issue that logs of a logger are duplicated. Here is an example code: import logging # config the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found