Java Service wrapper logging parameter setting and optimization

Source: Internet
Author: User

Generally in containers such as tomcat/weblogic run, we are all through the log4j control log output, because we are now a lot of server use Java Service wrapper (as to why the use of JSW, originally was more exclusive use, But when deploying more than 10 apps on a single server, we unconditionally chose JSW, because there is no need to toss and plan so many ports, especially when we are still own RPC, the port requirements for each application from 4 to 1 are started and managed, and JSW has its own log format, It can be said that on the log4j and a vest, the default log format is not the output of the original log4j information, because we have used log4j management, so no longer need JSW vest, which control the log format, size and scrolling by the following parameters.

 # Format of output for the console.  (see Docs for formats) wrapper.console.format=pm# LOG level for console output. (See docs for Log levels) wrapper.console.loglevel=info# log file to the use for wrapper output logging.wrapper.logfile=:  /logs/osm-runtime.log# Format of output for the log file.  (see Docs for formats) wrapper.logfile.format=m# log level for log file output.  (See docs for log levels) wrapper.logfile.loglevel=info# Maximum size, the log file would be allowed to grow The log is rolled.  Size is specified in bytes.  The default value# of 0, disables log rolling.  May abbreviate with the ' K ' (KB) or# ' m ' (MB) suffix. For example:10m = megabytes.wrapper.logfile.maxsize=10m# Maximum number of rolled log files which would be allowed BEFO  Re old# files are deleted.  The default value of 0 implies no limit.wrapper.logfile.maxfiles=100# log level for sys/event log output. (See docs for log levels) Wrapper.syslog.loglevel=none 

The values of format are as follows (posted on Google's CDN or embedded ads, not FQ open really slow):

Format to use for logging to the log file. Logging have been intentionally kept simple.

The format consists of the following tokens:

  • 'L ' for log level,
  • 'P ' for prefix,
  • 'D ' (Since ver. 3.1.0) for thread,
  • 'T ' for Time,
  • 'Z ' for millisecond time,
  • 'R ' quite duration milliseconds showing the time since the previous JVM output,
  • 'U ' (Since ver. 3.5.0) for approximate uptime in seconds (based on internal tick counter and was valid up to one year F Rom startup),
  • 'G ' (Since ver. 3.5.8) for time-milliseconds it tool to log the previous log entry (see wrapper. Log.warnin G.threshold for more information),
  • 'W ' (Since ver. 3.5.30) for the PID of the Wrapper process.
  • 'J ' (Since ver. 3.5.30) for the PID of the Java process (if the JVM was up).
  • 'M ' for message.

If the format contains these tokens above, then it'll be is output with the specified formation. The order of the tokens does not affect the the-the-appears, but the 'M ' (for message) token should usually is PLA CED last as it was the only column without a uniform width. If the property was missing tokens or commented out and then the default value 'Lptm ' would be used.

Logging Disable:

Setting the property to a blank value would cause file logging to be disabled.

Wrapper.logfile.format=

To set the log refresh interval:
Wrapper.logfile.flush.timeout=min (number of 5,1* processes)

Java Service wrapper logging parameter setting and optimization

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.