ci.maven
ci.maven copied to clipboard
Changing the logging directory not possible
Hello,
I have tried to change the logging directory (in the server.xml file). The plugin has not "seen" the server start.
It seems the Liberty plugin try to locate the "started message" in the default location.
This is an old issue but the problem still occurs: here
I just recreated this in 3.3.5-M2, on Windows.
I think we might have closed this before as a duplicate while fixing a partially-overlapping, similar problem, without fixing this problem. E.g. this fix: https://github.com/OpenLiberty/ci.maven/pull/253/files seems to fix the usecase when a WLP_OUTPUT_DIR is used in server.env but not a <logging logDirectory="C:\logs"... />
@BrentLeemans can you please mention what platform(s) you're using: Win/Mac/etc., and what version of liberty-maven-plugin (again, I don't think upgrading to the latest will resolve this) ? Thank you for opening the issue.
Stepping back and thinking out loud, this seems like a tricky problem to solve since we have to deal with the different config sources:
- server.xml config
- server.env variables
- liberty-maven-plugin config
AND we also have to "merge" the general output dir setting with the more specific log dir setting when appropriate.
Maybe another point I'm making: I don't think we support the LOG_DIR in server.env either.
ANOTHER NOTE/QUESTION
I didn't realize this, maybe it is already documented..but.. is it always supposed to be the case that the env vars get loaded only from server.env and NOT from the process launching mvn ? I think that would be a good design.. just taking the opportunity to ask/confirm this is documented.
@scottkurz Thank you for taking the time to review my issue. I'm using Ubuntu 20.04.2 LTS and my liberty-maven-plugin version is 3.2.3.
Hello. I am curious if there has been any movement on this issue? Thank you
Hello. I am curious if there has been any movement on this issue? Thank you
@ArkUmbra Hello, this issue has not been on our priority list so far.
Wanted to make a few points here based on the Liberty documentation.
- Changing the location of the logs dynamically after startup using the
<logging logDirectory=""/>
attribute is not recommended. See theAvoid trouble:
section in the attribute description. - There are at least two different ways to affect the location of the logs that our plugin should support....first the
WLP_OUTPUT_DIR
can be set in the environment or theserver.env
...second theLOG_DIR
can be set in the environment or theserver.env
. TheLOG_DIR
also has an equivalentcom.ibm.ws.logging.log.directory
property that could be specified inbootstrap.properties
. - The environment variables of the launching JVM are used if present, but the
server.env
takes precedence. This is documented here.
Note that I need to confirm that our plugin actually supports both ways to change the log location that I mentioned in point 2 above. I suspect we need some changes to support LOG_DIR
and its equivalent property. If so, I will use this issue to track those changes.