爲了能在Glassfish的4.1,我們的系統日誌必須改變下域中的logging.properties(例如的glassfish /域/域1 /配置)
線
handlerServices=com.sun.enterprise.server.logging.GFFileHandler
應該改變
handlerServices=com.sun.enterprise.server.logging.GFFileHandler,com.sun.enterprise.server.logging.SyslogHandler
見:[GLASSFISH-20718] Write to System Log option do not send log on localhost udp port 514
爲了使一個更清潔的方式這一變化,而不是改變logging.properties直接就可以使用asadmin如下:
bash-4.3# asadmin set-log-attributes handlers=java.util.logging.ConsoleHandler,com.sun.enterprise.server.logging.SyslogHandler
handlers logging attribute value set to java.util.logging.ConsoleHandler,com.sun.enterprise.server.logging.SyslogHandler.
The logging attributes are saved successfully for server.
最後,爲了使系統日誌,你可以調用的asadmin如下:
bash-4.3# asadmin set-log-attributes com.sun.enterprise.server.logging.SyslogHandler.useSystemLogging=true
com.sun.enterprise.server.logging.SyslogHandler.useSystemLogging logging attribute value set to true.
The logging attributes are saved successfully for server.