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

New feature: Admin command logger #24993

Merged

Conversation

OndroMih
Copy link
Contributor

@OndroMih OndroMih commented Jun 22, 2024

Fixes #24992

Provides a mechanism that logs admin commands that are invoked by the Admin Console, Admin CLI or the REST admin interface.

Demo of the functionality:

2024-06-21.17-56-45.mp4

Configuration as described in the docs in the PR. Copy of the docs here:

It's possible to log admin commands executed either using the asadmin CLI, Admin Console, or the REST interface.

To enable this logging, set the system property glassfish.commandlogger.logmode on the DAS server to one of the following values:

  • ALL_COMMANDS - will log all commands
  • WRITE_COMMANDS - will log all commands that modify server configuration
  • INTERNAL_COMMANDS - will log all commands that modify server configuration and also those that start with _ (internal commands)
  • READ_WRITE_COMMANDS - will log all commands that modify server configuration or return info about the configuration
  • NO_COMMAND - do not log any command, this is the default value if the property not specified

The log message will be logged using org.glassfish.extras.commandlogger.AdminCommandLogger logger with INFO level, and will contain:

  • name of the admin user that executed the command
  • name of the command
  • arguments to the command

The name and arguments can be copied and pasted to the asadmin CLI to repeat running the same command from the command line.

Note: SimpleTopicDistributionService.java is a temporary solution until eclipse-ee4j/glassfish-hk2#1058 is released and a new version of HK2 is integrated.

@OndroMih OndroMih force-pushed the ondromih-admin-command-logger branch from d52b989 to 21ff1b0 Compare June 22, 2024 00:48
@OndroMih OndroMih changed the title Ondromih admin command logger New feature: Admin command logger Jun 22, 2024
@arjantijms arjantijms requested review from dmatej and avpinchuk June 23, 2024 12:34
@arjantijms arjantijms merged commit fa637c6 into eclipse-ee4j:master Jun 25, 2024
2 checks passed
@dmatej dmatej added this to the 7.0.16 milestone Jun 25, 2024
@dmatej dmatej added the New feature A major new user functionality was added label Jun 25, 2024
@OndroMih OndroMih deleted the ondromih-admin-command-logger branch August 12, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature A major new user functionality was added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New feature: Admin command logger
5 participants