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

Logs caught with OutputDirectoryLogging.catchLogEntries() are empty #3531

Open
markusstraub opened this issue Oct 30, 2024 · 3 comments
Open

Comments

@markusstraub
Copy link
Contributor

Catching log statements with OutputDirectoryLogging.catchLogEntries() does not work with MATSim 2024.0 or 2025.0-SNAPSHOT.

Each log statement before logging is regularly initialized by the controller looks like this:

2024-10-30T09:13:26,415   OFF ?: 
2024-10-30T09:13:26,415   OFF ?: 
2024-10-30T09:13:26,415   OFF ?: 

I debugged a little bit:

  • during early logs you can watch the list of logEvents (with instances of MutableLogEvent) in CollectLogMessagesAppender grow - and the events in the list contain valid log entries
  • but when it's time to write them to the log (i.e. when OutputDirectoryLogging.initLogging is called from the controller) the length of the logEvents list seems to be OK but it only contains references to the same event with all fields set to null

But I have no clue where the log events are razed :/

How to reproduce: Run https://github.com/matsim-org/matsim-code-examples/blob/2024.x/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingWithControlerExample.java and have a look at logfile.log

@rakow
Copy link
Contributor

rakow commented Oct 30, 2024

Could it be that you are affected by issue #2318? Are you running matsim from an IDE or an executable jar ?

@markusstraub
Copy link
Contributor Author

I was running it from an IDE. Maybe you could try to reproduce it by running the example as well? So that we know it's not my setup.

@rakow
Copy link
Contributor

rakow commented Oct 30, 2024

Yes, I can reproduce the same issue.

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