Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log4j2: Use size based triggering instead of time based #9849

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions agent/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ under the License.
<!-- ================================= -->

<!-- A time/date based rolling appender -->
<RollingFile name="FILE" append="true" fileName="@AGENTLOG@" filePattern="@AGENTLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="FILE" append="true" fileName="@AGENTLOG@" filePattern="@AGENTLOG@.%i.gz">
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{3}] (%t:%x) (logid:%X{logcontextid}) %m%ex%n"/>
</RollingFile>
Expand Down
2 changes: 2 additions & 0 deletions build/replace.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DBPW=cloud
DBROOTPW=
MSLOG=vmops.log
APISERVERLOG=api.log
LOGMAXINDEX=10
LOGMAXFILESIZE=104857600
DBHOST=localhost
DBDRIVER=jdbc:mysql
AGENTLOGDIR=logs
Expand Down
10 changes: 6 additions & 4 deletions client/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,21 @@ under the License.
<!-- ================================= -->

<!-- A regular appender -->
<RollingFile name="FILE" append="true" fileName="@MSLOG@" filePattern="@MSLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="FILE" append="true" fileName="@MSLOG@" filePattern="@MSLOG@.%i.gz">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
</RollingFile>


<RollingFile name="APISERVER" append="true" fileName="@APISERVERLOG@" filePattern="@APISERVERLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="APISERVER" append="true" fileName="@APISERVERLOG@" filePattern="@APISERVERLOG@.%i.gz">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
</RollingFile>
Expand Down
2 changes: 2 additions & 0 deletions packaging/debian/replace.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ MSCONF=/etc/cloudstack/management
MSENVIRON=/usr/share/cloudstack-management
MSLOG=/var/log/cloudstack/management/management-server.log
MSLOGDIR=/var/log/cloudstack/management/
LOGMAXINDEX=10
LOGMAXFILESIZE=104857600
MSMNTDIR=/var/lib/cloudstack/mnt
MSUSER=cloud
PIDDIR=/var/run
Expand Down
2 changes: 2 additions & 0 deletions packaging/el8/replace.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ MSCONF=/etc/cloudstack/management
MSENVIRON=/usr/share/cloudstack-management
MSLOG=/var/log/cloudstack/management/management-server.log
MSLOGDIR=/var/log/cloudstack/management/
LOGMAXINDEX=10
LOGMAXFILESIZE=104857600
MSMNTDIR=/var/cloudstack/mnt
MSUSER=cloud
PIDDIR=/var/run
Expand Down
5 changes: 3 additions & 2 deletions plugins/hypervisors/hyperv/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ under the License.
<!-- ================================= -->

<!-- A time/date based rolling appender -->
<RollingFile name="FILE" append="true" fileName="@AGENTLOG@" filePattern="@AGENTLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="FILE" append="true" fileName="@AGENTLOG@" filePattern="@AGENTLOG@.%i.gz">
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{3}] (%t:%x) %m%ex%n"/>
</RollingFile>
Expand Down
10 changes: 6 additions & 4 deletions server/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ under the License.


<!-- A regular appender -->
<RollingFile name="FILE" append="true" fileName="@MSLOG@" filePattern="@MSLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="FILE" append="true" fileName="@MSLOG@" filePattern="@MSLOG@.%i.gz">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) %m%ex%n"/>
</RollingFile>
Expand All @@ -44,10 +45,11 @@ under the License.
</RollingFile>


<RollingFile name="APISERVER" append="true" fileName="@APISERVERLOG@" filePattern="@APISERVERLOG@.%d{yyyy-MM-dd}.gz">
<RollingFile name="APISERVER" append="true" fileName="@APISERVERLOG@" filePattern="@APISERVERLOG@.%i.gz">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) %m%ex%n"/>
</RollingFile>
Expand Down
5 changes: 3 additions & 2 deletions usage/conf/log4j-cloud_usage.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ under the License.
<!-- Append messages to the usage log -->
<!-- ================================ -->

<RollingFile name="USAGE" append="true" fileName="@USAGELOG@" filePattern="@USAGELOG@.%d{yyyy-MM-dd}{GMT}.gz">
<RollingFile name="USAGE" append="true" fileName="@USAGELOG@" filePattern="@USAGELOG@.%i.gz">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<DefaultRolloverStrategy max="@LOGMAXINDEX@"/>
<Policies>
<TimeBasedTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="@LOGMAXFILESIZE@"/>
</Policies>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{3}] (%t:%x) (logid:%X{logcontextid}) %m%ex%n"/>
</RollingFile>
Expand Down
Loading