返回文章列表

Notes: 更改glassfish的日志轮转数量

最近升级到glassfishv3.1.1之后,发现日志的数量始终保持在10个,判断是日志轮转数量有默认限制,查了官方文档,设置如下: [code] ./bin/asadmin set-log-attributes com.sun.enterprise.server.logging.GFFi...

1 分钟阅读

最近升级到glassfishv3.1.1之后,发现日志的数量始终保持在10个,判断是日志轮转数量有默认限制,查了官方文档,设置如下:

[code]
./bin/asadmin set-log-attributes
com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=50
[/code]

如果glassfish的默认管理端口变了,则需要指定管理端口号,如:

[code]
./bin/asadmin --port 4841 set-log-attributes
com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=50
[/code]

官方介绍如下:
The behavior of the com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles attribute is as follows:

If the property is not set, Oracle GlassFish Server keeps a maximum of 10 rotated log files.
If the property is set to an invalid number or null, Oracle GlassFish Server keeps a maximum of 10 rotated log files.
If the property is set to 0, Oracle GlassFish Server retains all rotated log files (that is, no sets no maximum).

评论交流

暂无评论,欢迎留下你的想法