0

is it possible to list all currently (at runtime) available components for which you can change the log level? So you don't have to know the exact name beforehand for some deployed application. E.g a command listing all available loggers for server1 in a websphere cluster.

Thank you, ralf

  • I don't know, if it is possible via scripting, but you can go to admin console `Troubleshooting > Logs and Traces > serverName > Change log level` to see all available loggers. – Gas Sep 17 '15 at 08:30
  • Thank you - do you know how to 'export' all the loggers shown? Or whether the feature 'Enable command assistance notifications' can be used in the view (I didn't get it to work) – ralf mindermann Sep 18 '15 at 06:40

1 Answers1

0

If you just want to export all loggers you could write very simple servlet/jsp to print all registered loggers, like this (I know, its not jython, but maybe it will be still useful for you):

@WebServlet("/LoggerTest")
public class LoggerTest extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        LogManager logManager = LogManager.getLogManager();

        Enumeration<String> loggerNames = logManager.getLoggerNames();
        while (loggerNames.hasMoreElements()) {
            String loggerName = (String) loggerNames.nextElement();
            System.out.println(loggerName);
        }
    }
}
Gas
  • 17,601
  • 4
  • 46
  • 93