In the operation of the process, sometimes we need to be different from the start WebLogic users to access or collect logs and other information to timely understand the system operation, which requires that the log file access permission is allowed to other users access. In general, the newly generated file default permissions are determined by the operating system's umask settings. How do you change the access rights of the log files generated by the WebLogic runtime?
If the umask command modification through the operating system is not in effect, because there is a command like "Umask 022" in Weblgoic's startup script startweblogic.sh, it overrides the operating system settings.
For example, "Umask 037" is set in startweblogic.sh, then the log file access rights generated are as follows:
-bash-4.2$ ls -ltotal 13164-rw-r----- 1 oracle oracle 842 Jul 25 04:30 access.log-rw-r----- 1 oracle oracle 2150626 Jul 27 10:35 AdminServer.log-rw-r----- 1 oracle oracle 576289 Jul 27 10:35 base_domain.log
We can control the access rights of new generated files such as logs by modifying the values of Umask in the script.
This works correctly on the WebLogic 11g. However, even if the umask is set on WebLogic 12.2.1.1.0 and 12.2.1.2.0, this is a WebLogic bug (Bug 24794915), which has been fixed on 12.2.1.3.0.
This patch needs to be installed on these two versions (12.2.1.1.0 and 12.2.1.2.0). The following parameters are already supported on the 12.2.1.3.0 and no patches need to be installed.
After installing the patch, a parameter-dweblogic.defaultlogfilepermissionsenabled is supported, which is true by default.
The meaning of this parameter is that when-dweblogic.defaultlogfilepermissionsenabled=true, the newly generated file uses the default file access permissions of 640. If you set-dweblogic.defaultlogfilepermissionsenabled=false, the access rights of the newly generated file are controlled by the values set in the Umask startweblogic.sh script, with the custom settings.
All on the weblogic12.2.* version, you need to add-dweblogic.defaultlogfilepermissionsenabled=false to start the parameter, Then modify the Umask value in the startweblogic.sh. Java options are typically set in setdomainenv.sh.
This parameter controls all the new files generated by WebLogic, not just the log files.
In addition, if WebLogic server is started by NodeManager, it needs to be set in the startnodemanager.sh script.
How do I set permissions for a log file generated by WebLogic?