zowe / zss

Zowe System Services Server for enabling low-level microservices
Eclipse Public License 2.0
13 stars 45 forks source link

Do not log into `zowe.runtimeDirectory` #726

Closed Martin-Zeithaml closed 2 weeks ago

Martin-Zeithaml commented 3 weeks ago

Proposed changes

This PR addresses Issue: https://github.com/zowe/zowe-install-packaging/issues/3495

This PR depends upon the following PRs:

Type of change

PR Checklist

Please delete options that are not relevant.

Testing

zowe.logDirectory not used in config:

No log directory. Logging disabled.     
ZWED_NODE_LOG_FILE=/dev/null            
...
No log directory. Logging disabled.    
ZWES_LOG_FILE=/dev/null                

zowe.logDirectory set to /zowe/logs/

ZWED_NODE_LOG_FILE=/zowe/logs/appServer-2024-08-27-07-39.log  
ZWES_LOG_FILE=/zowe/logs/zssServer-2024-08-27-07-39.log   
1000TurquoisePogs commented 3 weeks ago

You say "ommiting zowe.logDirectory forces the zss to log into the zowe.runtimeDirectory" But that was by design. It's intended for development: if you don't have a log directory, where should we log? We decided to log in the same location.

So yes you can change this behavior, but it sounds like the bug to me is actually: why does a user not have zowe.logDirectory ? Sounds like something the schema should prevent?

Martin-Zeithaml commented 3 weeks ago

1) The zowe.logDirectory is not mandatory and it is not in defaults.yaml. If you simply delete/comment out logDirectory line from config, it is valid from the schema point of view and app-server and zss are logging into zowe.runtimeDirectory. 2) I have created this issue to warn users from using zowe.runtimeDirectory. a) If this check will be implemented, we might check (just for sure) all directories. It is possible, some new users locate certificates into zowe.runtimeDirectory. 3) Making zowe.logDirectory mandatory in schema validation is too aggressive - you must have logDirectory for every zwe command. 4) I don't know, if schema is capable of such complicated check, what we really need is to compare "os.realpath(*Directory) vs os.realpath(runtimeDirectory)" - you can define there symbolic links, relative/absolute path and who knows what else. 5) At this point, you can define zowe.logDirectory and later comment it out - this check is better to do during the startup

Possible solution in launcher?

We make it the same as for zowe.workspaceDirectory: