-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The behavior of the server shell scripts in unsetting LOG_DIR env var is unexplained #6391
Comments
Chat conversation with Scott, Don & David Ramkumar K Scott Kurz I guess we could go on to mention X_LOG_DIR... but guessing we don't want to do that Ramkumar K Don Bourne Scott Kurz Don Bourne looks like that was part of "initial commit" 6 years ago unless someone on kernel team knows the rationale, we may just have to take it as "the way it is" and document what you ( Scott Kurz Don Bourne |
While Open Liberty provides the What I understood from the conversation - please correct me if I'm wrong. |
When I see So my suggestion is that the user creates their own env_var to both set |
While Open Liberty provides the LOG_DIR environment variable to configure the location of logs, it is not directly accessible as an environment variable within the server process. Instead, the value of the LOG_DIR environment variable is transferred to an X_LOG_DIR variable, which should be used when referencing the log directory in other contexts, such as configuration files. We could replace the mention of the X_LOG_DIR variable with an instruction for the user to create their own variable. Could you suggest some language for this? @scottkurz @donbourne |
@NottyCode any chance you know the history here? Why we unset LOG_DIR env var and replace it with X_LOG_DIR for the running process? |
@scottkurz I don't know why we do this, but I don't really want to document X_LOG_DIR, it feels very much like an internal to me. Why do you think we need to document X_LOG_DIR or LOG_DIR exactly? |
@NottyCode I agree we shouldn't document X_LOG_DIR. However, I think it's reasonable and useful for a user to expect they can access the LOG_DIR from their applications, and surprising to find out that we unset and wipe clean this variable, (it was surprising to the StackOverflow OP). If there's nothing helpful we can say here perhaps the status quo is even better than making a change. Perhaps I'm suggesting some sort of rationalization/explanation for why this is the case: "because logging is special we unset the LOG_DIR env var"??? I don't know... any ideas? |
Moving this issue into Icebox. Do not have enough information at this time. Regards, |
On the one hand we do a fine job explaining how the LOG_DIR env var will configure the location of the Liberty logs, (see: https://openliberty.io/docs/latest/log-trace-configuration.html#settings).
What we don't explain is that a LOG_DIR env var supplied in server.env can not be referenced as an environment variable. It is unset in https://github.com/OpenLiberty/open-liberty/blob/d4d2cad32f282fa48b0f9b8db36a234f32a96fa5/dev/com.ibm.ws.kernel.boot.ws-server/publish/bin/server#L580-L588 and the values are transferred to an X_LOG_DIR.
So if a user wants to use/reference their LOG_DIR value in some other context, they don't have an easy way of doing so.
Of course, they could consider using another approach like the bootstrap.properties in some use cases. But in this use case from StackOverflow, using SpringBoot application properties, this wouldn't be an option.
Is it doc'd that they could use X_LOG_DIR in this fashion?
Should this be explained or rationalized briefly?
The text was updated successfully, but these errors were encountered: