Trader: Diagnostics logging - Implement file-based error logging - #296
Open
konard wants to merge 3 commits into
Open
Trader: Diagnostics logging - Implement file-based error logging#296konard wants to merge 3 commits into
konard wants to merge 3 commits into
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #114
- Add NLog.Extensions.Logging package for cross-platform file logging - Configure NLog with separate error and all logs files - Add log rotation and archiving (10MB files, 7 error archives, 3 all archives) - Update Program.cs to use NLog provider - Add logs/ directory to .gitignore - Ensure NLog.config is copied to output directory Fixes #114 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
konard
marked this pull request as ready for review
September 13, 2025 01:42
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Issue Reference
Fixes #114
🔧 Implementation Summary
This PR implements comprehensive file-based error logging for the TraderBot application that works across all operating systems (Windows, Linux, macOS).
Changes Made
1. Added NLog Package
NLog.Extensions.Loggingv5.3.8 for cross-platform file logging capabilities2. NLog Configuration (
NLog.config)logs/errors-{date}.log- Captures errors and abovelogs/all-{date}.log- Captures all log levels (Info and above)${basedir}for OS-agnostic relative pathsconcurrentWrites="true"3. Application Updates
Program.csto configure NLog as the logging providerTraderBot.csprojto copy NLog.config to output directory.gitignoreto exclude logs directory from version control🌍 Cross-Platform Compatibility
The solution works on all operating systems because:
${basedir})📁 Log Structure
🧪 Testing
The implementation ensures all errors are now automatically logged to files while maintaining console output for development purposes.
🤖 Generated with Claude Code