Skip to content

NM-24: Configure Logback (port log4Net.xml)#8

Closed
devin-ai-integration[bot] wants to merge 1 commit into
devin/1779337581-nm22-spring-boot-initfrom
devin/1779373297-nm24-logback-config
Closed

NM-24: Configure Logback (port log4Net.xml)#8
devin-ai-integration[bot] wants to merge 1 commit into
devin/1779337581-nm22-spring-boot-initfrom
devin/1779373297-nm24-logback-config

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Ports the legacy log4Net.xml rolling file appender configuration from eShopLegacyMVCSolution/src/eShopLegacyMVC/log4Net.xml to a Spring Boot logback-spring.xml.

What's configured:

  • Rolling file appender: writes to logFiles/myapp.log with append mode, size-based rolling policy (10MB max file size, 5 backup files)
  • Console appender: enabled only when the dev Spring profile is active
  • Log pattern: %date [%thread] %X{activityId} %-5level %logger - %X{requestInfo}%n%message%n%n — maps the legacy log4net %property{activity} and %property{requestinfo} to Logback MDC keys

Mapping from log4Net.xml:

log4Net setting Logback equivalent
file=logFiles\myapp.log <file>logFiles/myapp.log</file>
appendToFile=true <append>true</append>
rollingStyle=Size FixedWindowRollingPolicy + SizeBasedTriggeringPolicy
maxSizeRollBackups=5 <maxIndex>5</maxIndex>
maximumFileSize=10MB <maxFileSize>10MB</maxFileSize>

Jira: NM-24

Review & Testing Checklist for Human

  • Run ./mvnw spring-boot:run -Dspring-boot.run.profiles=dev and verify console log output appears with the expected pattern
  • Verify logFiles/myapp.log is created and receives log entries
  • Confirm rolling behavior by generating enough logs to exceed 10MB (or temporarily lower maxFileSize for testing)

Notes

  • Based on the NM-22 branch (Story 0.1: Initialize Spring Boot Maven project)
  • The dev profile already exists in application-dev.yml with H2 in-memory database config
  • Build verified locally with mvn clean compile (Java 21)

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/88a7fd43bf8e468e8661ec22fe7c151e

Add logback-spring.xml that replicates the rolling file appender from
the legacy log4Net.xml configuration:
- File output to logFiles/myapp.log with append mode
- Size-based rolling policy (10MB max, 5 backup files)
- Log pattern with date, thread, level, logger, and message
- Console appender enabled for the dev Spring profile
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot deleted the branch devin/1779337581-nm22-spring-boot-init May 26, 2026 12:49
@devin-ai-integration devin-ai-integration Bot deleted the devin/1779373297-nm24-logback-config branch May 26, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants