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

Fixes around logging #24743

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Fixes around logging #24743

merged 4 commits into from
Jan 15, 2024

Conversation

dmatej
Copy link
Contributor

@dmatej dmatej commented Jan 14, 2024

  • The stop-domain did not print that the domain is not running, but just some method name instead.
  • When rolling the server.log file, several messages was lost. Closes GlassFishlogHandler can drop several LogRecord instances when it rotates the server.log file #24737
  • Reduced using method handles as parameters, better separation of features.
  • Some editors (Vim) delete before save, sometimes GF noticed the logging.properties vanished and then GF stopped its monitoring and reloading. As the file is critical, on this event now GF creates a special thread which resets everything to correct state after the file reappears.
  • Rolling the server.log file did not work on Windows when used with --verbose or --watch (also used by Windows Services), because Launcher had it's own handle to the file and Windows blocked attempts to move the file. Now Launcher removed its handler right before it starts the server which configures its own logging and continues writing to the server.log. This relates to Launcher should not touch server.log #24065 .

- This should fill the inability to rotate the log file on windows when it is
  started with watchdog or verbose.

Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
- When rolling, several log records were lost - doesn't happen any more
- Refactoring: separated features to own classes, which resolved some locking
  and reduced need of sharing method handles.

Signed-off-by: David Matějček <[email protected]>
- Some editors save the file so they delete and create it. But when GF noticed
  that the file was deleted, it disabled the mechanism used to refresh
  the configuration.
- Now it prints the warning, but then creates a special thread waiting until
  the file is backa again, then configuring the mechanism again.

Signed-off-by: David Matějček <[email protected]>
@dmatej dmatej added the bug Something isn't working label Jan 14, 2024
@dmatej dmatej added this to the 7.0.12 milestone Jan 14, 2024
@dmatej dmatej self-assigned this Jan 14, 2024
@avpinchuk
Copy link
Contributor

avpinchuk commented Jan 14, 2024

rotate-log command now works on Windows 10 for GlassFish started with --verbose and --watchdog options

@dmatej dmatej marked this pull request as ready for review January 15, 2024 14:51
@arjantijms arjantijms merged commit 180d03a into eclipse-ee4j:master Jan 15, 2024
2 checks passed
@dmatej dmatej deleted the fix-logging branch January 15, 2024 15:22
@mirozitnansky
Copy link

It seems to be working in test environment, but we still didn't deploy it to the production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GlassFishlogHandler can drop several LogRecord instances when it rotates the server.log file
4 participants