-
Notifications
You must be signed in to change notification settings - Fork 84
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
MetroLog stops logging when a few exceptions occurred #103
Comments
@basprins its hard to tell what might be the problem, but can you try these options. Sometime the file is locked and not released and other process cannot access it . streamingFileTarget.IncludeLogger = true; this should create a different file for each logger and you will find which logger is not working... Also, what i notice is if you have any Dependency injection or different projects where you are using the logger, then make sure you initialize the logger in each project. Also worth trouble shooting if the configuration code is executed when the logger tries to log..? Try those let us know if you go any further |
@MMalikKhan that's very helpful commenting! Thanks a lot for that. I left our machine in production for a day, and I can at least confirm that loggings is continued when a day is passed (and thus a new log file is created). So your suggestion of a file lock issue makes sense. I will start with creating a file per logger, and when I learn more I will share it here. Thanks again ! |
I added the "includelogger" in order to see which logs do continue to run. I made a copy of the directory listing, which indeed shows that a few loggers have stopped logging: 36bb0\LocalState\MetroLogs> ls | sort LastWriteTime -Descending
Mode LastWriteTime Length Name -a---- 10-3-2017 10:55 64130 Log - PulseDetector - 20170310.log As you can see these three stop logging around 21:29 -a---- 8-3-2017 21:29 111 Log - StateMachine - 20170308.log An (user handled) exception occurred at that time (the server connection failed, which recovered later). No sure why that would cause any trouble. The catch is nothing special either, just log and handle the exception.... You mentioned two other points: Also worth trouble shooting if the configuration code is executed when the logger tries to log..? Can you elaborate on both? How do I initialize the logger in another project (other than LogManagerFactory.GetLogger)? And how exactly do I see if configuration code is executed when the logger tries to log? Hope you can clarify a few parts for me, or maybe you have other ideas that might help me further. Many thanks again. |
I have a universal app that runs on a Raspberry Pi with Windows IoT which uses MetroLog as loggings framework.
For some completely unknown reasons to me, sometimes MetroLog decides to stop logging to file completely. My app still runs, and it responds and does what it should do, except that there are no new log entries (and I know for certain that code is executes with log statements).
The usage of MetroLog in my app is as follows:
Creation/initialization in my App.xaml.cs
For the rest, I have a lot of classes that have a static Logger instance, like this:
or:
and usage of these instances is straight forward like this:
The example above causes the logger to stop completely, it retries a couple of times, and I can see the log messages in the logging, and then nothing else gets logged.
Any idea how to troubleshoot this? I really have no clue whatsoever what is the cause of this weird behaviour.
Again. the App continues to run, and 100% sure code gets executes that contains log statements, so it seems that the logger died / stops flushing to disk?
The text was updated successfully, but these errors were encountered: