Last active
March 23, 2022 19:34
-
-
Save TiloGit/071105f053e1961146dcfe0622d1915c to your computer and use it in GitHub Desktop.
log4j2 for azure log monitoring file ingestion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RollingFile name="VFLOGMON" | |
filePattern="${sys:log.dir}/VFLOGMON/MyFlow-LogMon-%d{yyyy-MM-dd}-%i.log" | |
immediateFlush="true"> | |
<PatternLayout alwaysWriteExceptions="false" | |
pattern="%d %-5p [%t] %C{2} (%F:%L) - %enc{%m}{CRLF} %replace{%throwable}{[\r|\n]}{|}%n"/> | |
<Policies> | |
<TimeBasedTriggeringPolicy interval="1" | |
modulate="true"/> | |
<SizeBasedTriggeringPolicy size="22 MB"/> | |
</Policies> | |
<DirectWriteRolloverStrategy maxFiles="10"> <!-- maxFiles: only for created in the time period above (so 1 day) --> | |
<Delete | |
basePath="${sys:log.dir}/VFLOGMON" | |
maxDepth="1"> | |
<IfFileName glob="MyFlow-LogMon-*-*.log"/> | |
<!-- <IfLastModified age="P60D"/> --> | |
<IfAccumulatedFileCount exceeds="14" /> | |
</Delete> | |
</DirectWriteRolloverStrategy> | |
</RollingFile> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to support "Collect custom logs with Log Analytics agent in Azure Monitor" https://docs.microsoft.com/en-us/azure/azure-monitor/agents/data-sources-custom-logs