Skip to content

Commit

Permalink
CDAR-593: Update CDASim logging configuration to reduce log file size (
Browse files Browse the repository at this point in the history
…#327)

<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
Cherry picked CDASim logging changes from
#325
<!--- Describe your changes in detail -->

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
Reduce CDASim log file size
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
[CARMA Contributing
Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
  • Loading branch information
paulbourelly999 authored Mar 18, 2024
1 parent 109136d commit e9c33a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
54 changes: 28 additions & 26 deletions ail_vru_uc1_scenario/cdasim_config/cdasim/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<property name="logDirectory" value="${logDirectory}"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="STDOUT-Progress" class="ch.qos.logback.core.ConsoleAppender">
Expand All @@ -26,7 +26,7 @@
<charset>UTF-8</charset>
<file>${logDirectory}/MOSAIC.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>

Expand All @@ -35,15 +35,16 @@
<charset>UTF-8</charset>
<file>${logDirectory}/Mapping.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>

<appender name="ApplicationLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Application.log</file>
<immediateFlush>true</immediateFlush>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="ApplicationLogDelegation" class="ch.qos.logback.classic.sift.SiftingAppender">
Expand All @@ -67,81 +68,82 @@
<immediateFlush>true</immediateFlush>
<file>${logDirectory}/Navigation.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="TrafficLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Traffic.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="CarlaLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Carla.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="CarmaLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Carma.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="InfrastructureLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Infrastructure.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="EnvironmentLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Environment.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="CommunicationLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Communication.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>
<appender name="CommunicationDetailsLog" class="ch.qos.logback.core.FileAppender">
<file>${logDirectory}/CommunicationDetails.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
<append>false</append>
</appender>
<appender name="CellLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/Cell.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line - %msg%n</pattern>
</encoder>
</appender>

<appender name="ActivityLog" class="ch.qos.logback.core.FileAppender">
<charset>UTF-8</charset>
<file>${logDirectory}/RuntimeEvents.csv</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date %-5level %logger{0} [%thread] - %msg%n</pattern>
<pattern>%date %-5level %C{0}:%line [%thread] - %msg%n</pattern>
</encoder>
</appender>

<!--######################## LOGGER ############################### -->

<!-- new appenders for anything from Eclipse MOSAIC -->
<logger name="SimulationProgress" additivity="false" level="TRACE">
<logger name="SimulationProgress" additivity="false" level="INFO">
<appender-ref ref="MosaicLog"/>
<appender-ref ref="STDOUT-Progress"/>
</logger>
<logger name="MosaicStarter" additivity="false" level="TRACE">
<logger name="MosaicStarter" additivity="false" level="INFO">
<appender-ref ref="MosaicLog"/>
</logger>
<logger name="org.eclipse.mosaic.rti" additivity="false" level="INFO">
Expand Down Expand Up @@ -175,45 +177,45 @@
<appender-ref ref="CellLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.application.ambassador.navigation" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.application.ambassador.navigation" additivity="false" level="INFO">
<appender-ref ref="NavigationLog"/>
</logger>
<logger name="org.eclipse.mosaic.lib.routing" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.lib.routing" additivity="false" level="INFO">
<appender-ref ref="NavigationLog"/>
</logger>
<logger name="com.graphhopper" additivity="false" level="TRACE">
<logger name="com.graphhopper" additivity="false" level="INFO">
<appender-ref ref="NavigationLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.mapping" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.mapping" additivity="false" level="INFO">
<appender-ref ref="MappingLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.environment" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.environment" additivity="false" level="INFO">
<appender-ref ref="EnvironmentLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.sumo" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.sumo" additivity="false" level="INFO">
<appender-ref ref="TrafficLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.carla" additivity="false" level="TRACE">
<appender-ref ref="CarlaLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.carma" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.carma" additivity="false" level="INFO">
<appender-ref ref="CarmaLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.infrastructure" additivity="false" level="TRACE">
<logger name="org.eclipse.mosaic.fed.infrastructure" additivity="false" level="INFO">
<appender-ref ref="InfrastructureLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.output" additivity="false" level="INFO">
<appender-ref ref="MosaicLog"/>
</logger>

<logger name="activities" additivity="false" level="TRACE">
<logger name="activities" additivity="false" level="INFO">
<appender-ref ref="ActivityLog"/>
</logger>

Expand All @@ -224,7 +226,7 @@
<logger name="org.eclipse.mosaic.fed.ns3.ambassador.Ns3AmbassadorError" additivity="false" level="INFO">
<appender-ref ref="CommunicationDetailsLog"/>
</logger>

<logger name="org.eclipse.mosaic.fed.ns3.ambassador" additivity="false" level="DEBUG">
<appender-ref ref="CommunicationDetailsLog"/>
</logger>
Expand Down
1 change: 1 addition & 0 deletions ail_vru_uc1_scenario/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- /tmp/.X11-unix:/tmp/.X11-unix
- /opt/carma-simulation/logs:/opt/carma-simulation/logs
- ./carla-recorder/:/app/scenario_runner/metrics/data/
- ./cdasim/logback.xml:/opt/carma-simulation/etc/logback.xml
deploy:
resources:
reservations:
Expand Down

0 comments on commit e9c33a4

Please sign in to comment.