Skip to content

Feature/8 logger#10

Merged
TunixR merged 5 commits intomainfrom
feature/8-logger
Nov 17, 2024
Merged

Feature/8 logger#10
TunixR merged 5 commits intomainfrom
feature/8-logger

Conversation

@TunixR
Copy link
Copy Markdown
Contributor

@TunixR TunixR commented Nov 16, 2024

This pull request introduces a new logging system with Kafka integration and updates to the configuration and main application logic to support it. The most important changes include adding dependencies, updating the configuration file, creating a new logger module, and modifying the main application logic to utilize the new logger.

New Logging System:

  • Dependencies Added:

    • Added kafka, serde_json, chrono, and uuid to Cargo.toml.
  • Configuration Updates:

    • Updated config.yaml to include logger configuration options such as use_kafka, kafka_host, kafka_topic, and log file paths.
    • Added LoggerConfig struct to src/config/parser.rs to parse the new logger configuration options.
  • Logger Module:

    • Created a new logger module in src/config/logger.rs with methods for logging messages to files and Kafka.
    • Updated src/config/mod.rs to include the new logger module.

Main Application Logic:

  • Main Function Updates:

    • Modified src/main.rs to initialize the logger from the configuration and pass it to the request handler. [1] [2] [3]
  • Request Handling:

    • Updated the handle_request function in src/main.rs to log incoming connections, path not found errors, authorization failures, and downstream service connection issues using the new logger.

@TunixR TunixR requested a review from adrrf November 16, 2024 19:49
@TunixR TunixR self-assigned this Nov 16, 2024
@TunixR TunixR removed the request for review from alvarobernal2412 November 16, 2024 19:49
@github-actions github-actions Bot added the 😎 size/m Pull request size M label Nov 16, 2024
Copy link
Copy Markdown
Contributor

@adrrf adrrf left a comment

Choose a reason for hiding this comment

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

the code seems in order, but it would be nice to have kafka and the service dockerized for testing in my local machine

Base automatically changed from feature/rust to main November 17, 2024 10:04
@TunixR TunixR linked an issue Nov 17, 2024 that may be closed by this pull request
2 tasks
@TunixR
Copy link
Copy Markdown
Contributor Author

TunixR commented Nov 17, 2024

the code seems in order, but it would be nice to have kafka and the service dockerized for testing in my local machine

The logger is a separate service with its own kafka deployed. This service does not need an instace of kafka

@TunixR TunixR merged commit 2cb2b57 into main Nov 17, 2024
@TunixR TunixR deleted the feature/8-logger branch November 17, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

😎 size/m Pull request size M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Logger

2 participants