Skip to content

Instantly share code, notes, and snippets.

@gaurav21
Last active December 9, 2022 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaurav21/218c6cb85495fe8904ef06dfa7a4d571 to your computer and use it in GitHub Desktop.
Save gaurav21/218c6cb85495fe8904ef06dfa7a4d571 to your computer and use it in GitHub Desktop.
peii-compass
<targets>
<target xsi:type="File" name="base" fileName="${logDirectory}/peii-compass-${shortdate}.log" archiveNumbering="Sequence" archiveAboveSize="1048576" archiveFileName="${logDirectory}/{#######}.log">
<!-- Add includeMdlc="true" to emit MDC properties -->
<layout xsi:type="JsonLayout" includeMdlc="true">
<attribute name="date" layout="${longdate}" />
<attribute name="event-properties" layout="${item=EventId_Id}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="logger" layout="${logger}" />
<attribute name="message" layout="${message}" />
<attribute name="exception" layout="${exception:format=ToString}" />
</layout>
</target>
<target xsi:type="File" name="api" fileName="${logDirectory}/peii-compass-${shortdate}-api.log"
archiveNumbering="Sequence" archiveAboveSize="1048576" archiveFileName="${logDirectory}/{#######}.log">
<!-- Add includeMdlc="true" to emit MDC properties -->
<layout xsi:type="JsonLayout" includeMdlc="true">
<attribute name="date" layout="${longdate}" />
<attribute name="event-properties" layout="${item=EventId_Id}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="logger" layout="${logger}" />
<attribute name="message" layout="${message}" />
<attribute name="exception" layout="${exception:format=ToString}" />
<attribute name="url" layout="${aspnet-request-url}" />
<attribute name="action" layout="${aspnet-mvc-action}" />
</layout>
</target>
<target xsi:type="Console" name="console">
<!-- Add includeMdlc="true" to emit MDC properties -->
<layout xsi:type="JsonLayout" includeMdlc="true">
<attribute name="date" layout="${longdate}" />
<attribute name="event-properties" layout="${item=EventId_Id}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="logger" layout="${logger}" />
<attribute name="message" layout="${message}" />
<attribute name="exception" layout="${exception:format=ToString}" />
</layout>
</target>
</targets>
RUN ln -sf /proc/1/fd/1 /opt/peii/peii-compass/logs/peii-compass-*.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment