From 607a7f22995ec2444c3ce140179b39c8abe4f666 Mon Sep 17 00:00:00 2001 From: Ondro Mihalyi Date: Thu, 20 Jun 2024 02:01:21 +0200 Subject: [PATCH] GH24992 Admin Logger: Documentation on logging admin commands --- .../main/asciidoc/general-administration.adoc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/administration-guide/src/main/asciidoc/general-administration.adoc b/docs/administration-guide/src/main/asciidoc/general-administration.adoc index d763cac5d07..79d837eccdd 100644 --- a/docs/administration-guide/src/main/asciidoc/general-administration.adoc +++ b/docs/administration-guide/src/main/asciidoc/general-administration.adoc @@ -1075,6 +1075,7 @@ Status of MEjbApp is enabled Command show-component-status executed successfully. ---- + [[using-rest-interfaces-to-administer-glassfish-server]] === Using REST Interfaces to Administer {productName} @@ -3158,3 +3159,24 @@ specify the type through the `-H` option as follows: * For XML, specify `-H "Content-type: application/xml"`. * For form URL encoded, specify `-H "Content-type: application/x-www-form-urlencoded"`. +[[log-executed-admin-commands]] +=== Log executed admin commands + +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.commandrecorder.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 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. +