

Jvm日志记录 :java的sip
source link: https://www.jdon.com/63302
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Jvm日志记录 :java的sip
VM 日志记录长期以来一直是 JDK 的一部分。它可以成为执行根本原因分析和找出性能怪癖的绝佳工具。在 JDK 9 中,对 VM 日志记录的处理方式进行了一些更改,使其更加用户友好和可配置。让我们看看本文中如何使用 VM 日志记录。
启用和配置日志记录
添加-Xlog到您的java命令,可以在最基本的级别启用 VM 日志记录。这将使用以下默认配置启用 VM 日志记录:
-Xlog:all=info:stdout:uptime,levels,tags |
以上将在信息级别为所有不同类别打开 VM 日志记录。它会将 VM 日志打印到 stdout,包括 JVM 的正常运行时间、日志语句的级别以及与之关联的标签。
下面是这样一个日志语句的输出例子:
[1.043s][info][methodhandles ] lookup_polymorphic_method => intrinsic {method} {0x000000010a38c880} |
配置标签
开发人员在启用 VM 日志记录时通常会调查特定问题。VM 日志记录可以配置为仅生成与特定类别匹配的日志,例如;垃圾回收 ( gc)、即时编译器 ( jit)、CPU 使用率 ( cpu) 等。将日志记录限制为特定类别有助于减少噪音并让您专注于关注的领域:
-xlog:gc,heap |
标签可以被设置为不同级别的日志;off, trace, debug, info, warning, error;例如,如果我想对堆进行调试日志,但对GC进行错误日志,它将看起来像这样
-Xlog:'gc*=error,heap*=debug' |
配置输出位置
默认情况下,虚拟机日志将打印到stdout;但是,这可能并不是虚拟机日志需要发送的位置;在许多情况下,最好将虚拟机日志写入一个单独的文件,可以这样做:
-Xlog:'gc*,heap*':vm-logging.log |
减少性能开销
虚拟机日志可能会给Java应用程序带来非同小可的开销。为了帮助解决这个问题,可以考虑启用异步日志 -Xlog:async,这将把日志语句写到内存缓冲区,并定期刷新。缓冲区的大小可以用-XX:AsyncLogBufferSize=<bytes>来配置。就像在这个例子中。
-Xlog:'gc*=trace':gc-trace.log -Xlog:async -XX:AsyncLogBufferSize=102400 |
在正在运行中的JVM上配置日志
可以用jcmd和VM.log在JVM上配置VM日志。在用java命令配置虚拟机日志时,所有的配置选项都是可用的,但通过输出output、output_options、what和decorators等参数来提供选项,就像下面的例子:
jcmd <pid> VM.log output="file=heap.log" output_options="filecount=5,filesize=10m" what="heap=info" decorators="time,level" |
参考:
Enable Logging with the JVM Unified Logging Framework
Recommend
-
14
MacOS 10.12.5关闭SIP,升级自带的openssl由于Mac自带的 openssl 太老了,安装python扩展包报错,需要升级到高版本。一、安装openssl查看当前的openssl 的版本和目录:
-
5
SIP Trunking Proves Critical Link For Business Telecom ...
-
8
保护SIP连接的有效方法 责任编辑:cres 作者:Kevin Tolly | 2021-08-06 10:48:53 原创文章 企业网D1Net 会话发起协议(SIP)是管理设备如何通过互联网进行通信的基础标准。像大多数安全问题一...
-
13
This guide will help you to install Latest Kamailio SIP Server on CentOS 7 / CentOS 8 Linux server. This is part of Series tutorials on Building an Enterprise VOIP System. Kamailio is...
-
8
Raspberry Pi Zero W takes a SiP of Cortex-A53 Oct 28, 2021 — by Eric Brown 134 views
-
5
Shroot farms — Microsoft reports SIP-bypassing “Shrootless” vulnerability in macOS Exploit based on SIP entitlement inheritance was patched by Apple on October 26. ...
-
16
如何在 MacOS 关闭 SIP – Becomin' Charles 跳至内容 Becomin' Charles Mac |...
-
4
OPPO实时音视频(OPPO Real-Time Communication ORTC),是我们推出一套低延时、高品质、跨平台的音视频互通解决方案,通过OPPO云服务器向开发者开放,提供多人音视频通话、实时监控、应急指挥调度、互通直播、IOT万物互融、云游戏等能力输出。以往的音视频通信技...
-
13
Install Kamailio SIP Server on CentOS 8Search ComputingForGeeksThis guide will help you to install Latest Ka...
-
7
Mutual Funds SIP Calculator in Python Filed Under: PythonSimply put, a Mutual Funds SIP is a Systematic Inve...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK