日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java service wrapper日志参数设置及优化

發布時間:2024/8/26 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java service wrapper日志参数设置及优化 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一般在容器比如tomcat/weblogic中運行時,我們都是通過log4j控制日志輸出的,因為我們現在很多服務端使用java service wrapper(至于為什么使用jsw,原先是比較排斥使用的,但是當一臺服務器上部署10來個應用時,我們無條件的選擇了jsw,因為不需要折騰和規劃這么多的端口了,尤其是我們還是自己的RPC時,每個應用的端口需求從4個變成了1個)進行啟動和管理,而JSW還有自己的日志格式,可以說在log4j上又套了一層馬甲,默認的日志格式并不是輸出原始log4j信息,因為我們已經使用log4j管理了,所以不再需要JSW的馬甲,其通過如下參數控制日志格式、大小以及滾動。

# 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 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 that the log file will be allowed to grow to before # 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 = 10 megabytes. wrapper.logfile.maxsize=10m# Maximum number of rolled log files which will be allowed before 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

format的取值如下(貼出來純屬官網依賴google的cdn或嵌入廣告,不FQ打開實在慢):

Format to use for logging to the log file. Logging has 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 is valid up to one year from startup),
  • 'G' (Since ver. 3.5.8) for time in milliseconds it tool to log the previous log entry (See wrapper.log.warning.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 is up).
  • 'M' for message.

If the format contains these tokens above, then it will be output with the specified formation. The order of the tokens does not affect the way the log appears, but the 'M' (for message) token should usually be placed last as it is the only column without a uniform width. If the property is missing tokens or commented out, then the default value 'LPTM' will be used.

Logging Disable:

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

wrapper.logfile.format=

設置日志刷新間隔: wrapper.logfile.flush.timeout=min(5,1*進程數)

eclipse集成wrapper,可參考http://wrapper.tanukisoftware.com/doc/english/qna-eclipse-integration.html

轉載于:https://www.cnblogs.com/zhjh256/p/6364119.html

總結

以上是生活随笔為你收集整理的java service wrapper日志参数设置及优化的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。