Giter Site home page Giter Site logo

Comments (3)

MMalikKhan avatar MMalikKhan commented on July 30, 2024

@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.

basprins avatar basprins commented on July 30, 2024

@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.

basprins avatar basprins commented on July 30, 2024

@MMalikKhan

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.