Class BootLoggingConfiguration


  • public class BootLoggingConfiguration
    extends Object
    Generates a new logging.properties file based on the logging subsystem model.

    This should be considered a hack which generates a logging.properties file. The generated file will not necessarily be identical to that of which WildFly generates. Expressions will be written to the generated file. For this reason a new file will be generated which the entry point needs to load as system properties before the log manager is configured.

    Also handlers, formatters and filters considered explicit will not be configured at boot. As they are not used by another resource this should not be an issue. Once the logging subsystems runtime phase is executed these resources will be initialized.

    Author:
    James R. Perkins
    • Constructor Detail

      • BootLoggingConfiguration

        public BootLoggingConfiguration()
        Creates a configuration generator.
    • Method Detail

      • generate

        public void generate​(Path configDir,
                             org.jboss.as.controller.client.ModelControllerClient client)
                      throws IOException
        Generates a logging.properties file based on the logging configuration.
        Parameters:
        configDir - the configuration directory where the logging.properties should be stored
        client - the client used to communicate with a running server
        Throws:
        IOException - if an error occurs communicating with the server
        RuntimeException - if a server operation is unsuccessful
      • generateBootLoggingConfig

        public static void generateBootLoggingConfig​(String[] cp,
                                                     Path home,
                                                     Path output)
                                              throws IOException
        Generate the logging configuration in a forked process.
        Parameters:
        cp - the class path used to fork the logging config generator
        home - the server home directory
        output - the path to the output file for the process
        Throws:
        IOException - if an error occurs when creating the process