How do I set permissions for a log file generated by WebLogic?

Source: Internet
Author: User

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.