VMware vCenter:content-library-runtime.log.stdout 增长导致/storage/log目录满
1、通过 SSH 连接到 VCSA
2、要暂时解决空间问题,请从 content-library-runtime.log.stdout中清除内容:
cd /storage/log/vmware/content-library/
echo > content-library-runtime.log.stdout
3、/etc/vmware-content-library/log4j.properties备份并置空
cd /etc/vmware-content-library/
cp -R log4j.properties log4j.properties.old
cat /dev/null > log4j.properties
4、编辑log4j.properties
vi log4j.properties
黏贴下面代码,保存
# Copyright (c) 2022 VMware, Inc. All rights reserved. VMware Confidential
# If vcde.log.dir is passed as system property, the ${vcde.log.dir} will use system property instead.
vcde.log.dir=${vcde.home}/logs
# Set maxFileSize to 50MB
maxFileSize=52428800
# The maximum value of maxFileIndex is 12 when FixedWindowRollingPolicy is used. In case more history logs
# are needed, please increase the maxFileSize, eg. to 80MB or 100MB
maxFileIndex=12
log.level=DEBUG
log.file.prefix=${vcde.log.dir}/cls
log.pattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} | %-8p | %-16A | %-25t | %-30c{1} | %m%n
log4j.rootLogger=WARN, filelog
# CL log file config
log4j.appender.filelog=org.apache.log4j.rolling.RollingFileAppender
log4j.appender.filelog.rollingPolicy=org.apache.log4j.rolling.FixedWindowRollingPolicy
log4j.appender.filelog.rollingPolicy.maxIndex=${maxFileIndex}
log4j.appender.filelog.triggeringPolicy=org.apache.log4j.rolling.SizeBasedTriggeringPolicy
log4j.appender.filelog.triggeringPolicy.MaxFileSize=${maxFileSize}
log4j.appender.filelog.rollingPolicy.FileNamePattern=${log.file.prefix}-%i.log.gz
log4j.appender.filelog.rollingPolicy.ActiveFileName=${log.file.prefix}.log
log4j.appender.filelog.layout=com.vmware.vdcs.activation.logging.ActivationPatternLayout
log4j.appender.filelog.layout.ConversionPattern=${log.pattern}
log4j.appender.filelog.threshold=${log.level}
# Default Unified CL loggers
log4j.logger.com.vmware.vapi=${log.level}
log4j.logger.com.vmware.cis=${log.level}
log4j.logger.com.vmware.cl=${log.level}
log4j.logger.com.vmware.csf=${log.level}
log4j.logger.com.vmware.iso=${log.level}
log4j.logger.com.vmware.ovfs=${log.level}
log4j.logger.com.vmware.transfer=${log.level}
log4j.logger.com.vmware.vmtx=${log.level}
log4j.logger.com.vmware.vcde=${log.level}
log4j.logger.com.vmware.vcenter.nsx=${log.level}
log4j.logger.com.vmware.vcloud.activity=${log.level}
log4j.logger.com.vmware.vcloud.pbm=${log.level}
log4j.logger.com.vmware.vdcs=${log.level}
log4j.logger.com.vmware.vdcs.task=${log.level}
log4j.logger.com.vmware.vsphere=${log.level}
# shut off HttpProtocolBindingBase (bug 1039217)
log4j.logger.com.vmware.vim.vmomi.client.http.impl.HttpProtocolBindingBase=ERROR
# Uncomment to see VLSI logs
#log4j.logger.com.vmware.vcloud.vlsi=${log.level}
# Avoid excessive DEBUG logs
log4j.logger.com.vmware.cis.authorization.client.impl.ClientSideCache=INFO
log4j.logger.com.vmware.vapi.protocol.server.msg.json.JsonServerConnection=INFO
log4j.logger.com.vmware.cis.common.sso.impl.ClientHelperImpl=INFO
log4j.logger.com.vmware.vapi.cis.authz.impl.AuthorizationFilter=INFO
log4j.logger.org.springframework=INFO
log4j.logger.org.springframework.orm.jpa.JpaTransactionManager=INFO
log4j.logger.org.springframework.core.env.StandardEnvironment=INFO
# Uncomment to see VIM logs
#log4j.logger.com.vmware.vim=${log.level}
# Uncomment to see vAPI logging
#log4j.logger.com.vmware.vapi=${log.level}
# Uncomment to see CIS logging
#log4j.logger.com.vmware.cis=${log.level}
# Uncomment to see HTTP client logging
#log4j.logger.org.apache.http=${log.level}
# Uncomment to see SQL queries
#log4j.logger.org.hibernate=${log.level}
# Uncomment to see activity framework trace messages
# log4j.logger.com.vmware.vcloud.activity=TRACE
# log4j.logger.com.vmware.vdcs.task=TRACE
# Uncomment to enable diagnostics logging to a separate log
#log4j.category.com.vmware.vsphere.vcde.diagnostics.JsonDumper$Sampler=TRACE, diagnostic
# log4j.additivity.com.vmware.vsphere.vcde.diagnostics=false
# log4j.additivity.com.vmware.vsphere.vcde.diagnostics.impl=false
# log4j.appender.diagnostic=org.apache.log4j.RollingFileAppender
# log4j.appender.diagnostic.File=${vcde.log.dir}/cls-diagnostic-trace.log
# log4j.appender.diagnostic.MaxFileSize=${maxFileSize}
# log4j.appender.diagnostic.MaxBackupIndex=${maxFileIndex}
# log4j.appender.diagnostic.layout=com.vmware.vdcs.activation.logging.ActivationPatternLayout
# log4j.appender.diagnostic.layout.ConversionPattern=%m%n
# log4j.appender.diagnostic.threshold=TRACE
5、验证文件所有权/权限并进行相应更改:
chown content-library:cis log4j.properties
chmod 640 log4j.properties
6、使用以下命令重新启动内容库服务:
service-control --restart content-library