Comments (3)
@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
from metrolog.
@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 !
from metrolog.
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
Directory: \\minwinpc\c$\Data\Users\DefaultAccount\AppData\Local\Packages\Durocan_ns7r26fq36bb0\LocalState\MetroLog
s
Mode LastWriteTime Length Name
-a---- 10-3-2017 10:55 64130 Log - PulseDetector - 20170310.log
-a---- 10-3-2017 07:58 640 Log - Heater3(pin=21 - 20170310.log
-a---- 10-3-2017 07:58 640 Log - Heater2(pin=20 - 20170310.log
-a---- 10-3-2017 07:58 640 Log - Heater1(pin=16 - 20170310.log
-a---- 10-3-2017 00:44 1065 Log - Heater3(pin=21 - 20170309.log
-a---- 10-3-2017 00:44 1065 Log - Heater2(pin=20 - 20170309.log
-a---- 10-3-2017 00:44 1065 Log - Heater1(pin=16 - 20170309.log
-a---- 10-3-2017 00:44 144423 Log - PulseDetector - 20170309.log
-a---- 8-3-2017 22:03 135316 Log - PulseDetector - 20170308.log
-a---- 8-3-2017 21:29 111 Log - StateMachine - 20170308.log
-a---- 8-3-2017 21:29 1268990 Log - ExecutingScheme - 20170308.log
-a---- 8-3-2017 21:29 9661 Log - 20170308.log
-a---- 8-3-2017 21:29 8970 Log - CloudClient - 20170308.log
-a---- 8-3-2017 17:26 1366 Log - Heater3(pin=21 - 20170308.log
-a---- 8-3-2017 17:26 1366 Log - Heater2(pin=20 - 20170308.log
-a---- 8-3-2017 17:26 1366 Log - Heater1(pin=16 - 20170308.log
-a---- 8-3-2017 00:59 17761 Log - PulseDetector - 20170307.log
-a---- 8-3-2017 00:59 175469 Log - ExecutingScheme - 20170307.log
-a---- 8-3-2017 00:17 104 Log - Heater3(pin=21 - 20170307.log
-a---- 8-3-2017 00:17 104 Log - Heater2(pin=20 - 20170307.log
-a---- 8-3-2017 00:17 104 Log - Heater1(pin=16 - 20170307.log
-a---- 7-3-2017 22:05 276 Log - 20170307.log
-a---- 7-3-2017 22:05 1206 Log - StateMachine - 20170307.log
-a---- 7-3-2017 22:05 644 Log - I2CChannel - 20170307.log
-a---- 7-3-2017 22:05 168 Log - Arduino - 20170307.log
-a---- 7-3-2017 22:05 2608 Log - LoadConfiguration - 20170307.log
-a---- 7-3-2017 22:05 194 Log - App - 20170307.log
As you can see these three stop logging around 21:29
-a---- 8-3-2017 21:29 111 Log - StateMachine - 20170308.log
-a---- 8-3-2017 21:29 1268990 Log - ExecutingScheme - 20170308.log
-a---- 8-3-2017 21:29 9661 Log - 20170308.log
-a---- 8-3-2017 21:29 8970 Log - CloudClient - 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, 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..?
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.
from metrolog.
Related Issues (20)
- no json data written
- Multiple FileStreamingTarget in DefaultConfiguration HOT 2
- GlobalCrashHandler doesn't give stack trace/location HOT 1
- Using a custom trace layout in StreamingFileTarget HOT 1
- Change StreamingFileTarget's file name HOT 1
- Logging in local time HOT 1
- Read the current log file in UWP HOT 2
- Many unhandled exceptions with WriteAsync when using logger in UWP app
- Code Cluthering, SRP, KISS, 10/100, ... Violation?
- Crash with Thai locale HOT 5
- Release build is failing with error saying missing implementation on type 'MetroLog.Targets.StreamingFileTarget' HOT 1
- How to flush BufferedTarget (and its descendants) when buffer size less than threshold? HOT 1
- The process cannot access the file because it is being used by another process. The file is in use. Please close the file before continuing. HOT 1
- Exception thrown: 'System.IO.FileLoadException' in System.Private.CoreLib.dll WinRT information: The file is in use. Please close the file before continuing.
- Messages not always formatted
- GetCompressedLogs- how to for xamarin.forms project? HOT 13
- MetroLog for .Net 6 and Maui
- GlobalCrashHandler does not pass exception to Layout
- no message written to file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metrolog.