2

When I set a logDirectory in my server.xml I get the following error when starting up the server:

Unable to verify if the server was started after 30 seconds. Consider increasing the serverStartTimeout value if this continues to occur.

I created an issue on github: https://github.com/OpenLiberty/ci.maven/issues/1224 And it looks like they're aware of this issue and already resolved it but it still occurs. Anyone knows a workaround?

BrentL
  • 47
  • 1
  • 10

1 Answers1

1

Looks like you found another part of the problem which obviously was not fully resolved (thank you for raising the issue).

One approach for a workaround might be just to set the entire output directory to an alternate location, rather than only trying to set your logs directory to an alternate location. So something like:

  1. REMOVE the logDirectory attribute from the <logging> element in server.xml.

  2. Set the output directory via liberty-maven-plugin:

        <plugin>
                <groupId>io.openliberty.tools</groupId>
                <artifactId>liberty-maven-plugin</artifactId>
                <configuration>
                    <outputDirectory>C:/liberty-output</outputDirectory>
  1. OR, (as an alternate to 2.), instead of using plugin config, you can set the output directory in src/main/liberty/config/server.env:

WLP_OUTPUT_DIR=C:/liberty-output

NOTE

Note that you'll get some extra directories nested in this solution.

You'll get something like:

C:/liberty-output/defaultServer/logs/messages.log

Rather than:

C:/liberty-output/messages.log
Scott Kurz
  • 4,985
  • 1
  • 18
  • 40
  • Thank you for taking the time to look at my issue! I wanted to change the logDirectory location so my logs won't get overwritten when I restart the server. – BrentL Jul 27 '21 at 08:40
  • OK, another part to a workaround might be to retain more log files by using the 'maxFiles' attribute...e.g. `` (which obviously requires more disk space). But yes, it'd be nicer to be able to just set the log dir w/o resetting the whole output dir like in my workaround, and you should expect to be able to so it's a bug. – Scott Kurz Jul 27 '21 at 13:13
  • 1
    For now I created a bash script which copies the log files to another directory before the mvn stop:liberty command gets executed. – BrentL Jul 28 '21 at 20:48