rotate-log command is not working on payara micro

166 views
Skip to first unread message

Parimal jana

unread,
Aug 3, 2021, 6:46:37 AM8/3/21
to Payara Forum
Hi team , 
I am trying to rotate serverlog using rotate-log command , but it is not working on payara micro , can you please help me to rotate the file based on file size and file name after rotation should contain date like server.log_2021-07-31T14-06-23 

Parimal jana

unread,
Aug 3, 2021, 6:49:41 AM8/3/21
to Payara Forum
configuration details :

java.util.logging.FileHandler.limit=50000

java.util.logging.FileHandler.count=1

java.util.logging.FileHandler.level=FINEST

java.util.logging.FileHandler.formatter=com.sun.enterprise.server.logging.ODLLogFormatter

java.util.logging.FileHandler.append=true

java.util.logging.FileHandler.pattern=/opt/payara/domain/logs/server.log

handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler

java.util.logging.ConsoleHandler.formatter=com.sun.enterprise.server.logging.UniformLogFormatter


com.sun.enterprise.server.logging.GFFileHandler.logStandardStreams=true

com.sun.enterprise.server.logging.GFFileHandler.logtoFile=true

com.sun.enterprise.server.logging.GFFileHandler.rotationLimitInBytes=2000000

com.sun.enterprise.server.logging.GFFileHandler.rotationTimelimitInMinutes=0

com.sun.enterprise.server.logging.GFFileHandler.flushFrequency=1

com.sun.enterprise.server.logging.GFFileHandler.multiLineMode=true

com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=0

com.sun.enterprise.server.logging.GFFileHandler.rotationOnDateChange=false

com.sun.enterprise.server.logging.GFFileHandler.compressOnRotation=false  

#-- true

com.sun.enterprise.server.logging.GFFileHandler.file=/opt/payara/domain/logs/servergelf.log

com.sun.enterprise.server.logging.GFFileHandler=ALL

handlerServices=com.sun.enterprise.server.logging.GFFileHandler,com.sun.enterprise.server.logging.SyslogHandler

com.sun.enterprise.server.logging.GFFileHandler.formatter=com.sun.enterprise.server.logging.ODLLogFormatter


Rudy De Busscher

unread,
Aug 4, 2021, 5:40:25 AM8/4/21
to Payara Forum
Hi,

Can you indicate how you have configured the logging properties with Payara Micro. (did you use the --logProperties option https://docs.payara.fish/community/docs/documentation/payara-micro/appendices/cmd-line-opts.html ?)

Regards
Rudy

Parimal jana

unread,
Aug 4, 2021, 9:26:07 AM8/4/21
to Rudy De Busscher, Payara Forum
Hi Rudy,
Below is the docker entry point configuration .

ENTRYPOINT ["java", "-jar", "/opt/payara/payara-micro.jar", "--rootDir", "domain", "--postbootcommandfile", "post-boot.txt", "--prebootcommandfile", "pre-boot.txt", "--deploymentDir", "/opt/payara/deployments", "--accesslog", "/opt/logs", "--accessloginterval", "1", "--accesslogformat", "combined", "--logProperties", "r-pay-admin-dir/logging.properties"]


I have placed above log configuration into logging.properties file .


Thanks,
Parimal


--
You received this message because you are subscribed to a topic in the Google Groups "Payara Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/payara-forum/QcMr9h5y4Mk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/df3f1938-3623-47d2-b5ab-de0d3d11277en%40googlegroups.com.

Rudy De Busscher

unread,
Aug 5, 2021, 3:11:47 AM8/5/21
to Payara Forum

Hi,

Sorry, I confused a few things.

Payara Micro only uses the Java Util Logging capabilities as the GFFileHandler (and other capabilities) is not bundled within the distribution.

You configured the ConsoleHandler and the FileHandler to handle the log entries but the FileHandler does not support rotating log files.

You can achieve a rotating log file by using log4j2 (and using the jul to log4j bridge) and the rotating file appender.

Regards
Rudy
Reply all
Reply to author
Forward
0 new messages