Skip to content

feat(logging): update the current logging implementation#94

Merged
sufyankhanrao merged 92 commits intomainfrom
poc-logging
Apr 23, 2024
Merged

feat(logging): update the current logging implementation#94
sufyankhanrao merged 92 commits intomainfrom
poc-logging

Conversation

@hamzamahmood
Copy link
Copy Markdown
Contributor

@hamzamahmood hamzamahmood commented Apr 18, 2024

What

This PR updates the current implementation of the logging and logging configuration and some code cleanup changes.

  • We renamed HttpLogger to SdkLogger
  • We added ConsoleLogger for logging to console without logging providers
  • We added NullLogger that implements ApiLogger
  • We updated SdkLogger to only have logRequest and logResponse methods only
  • We updated ApiLoggingConfiguration to now have multi-level configuration for request and response
  • We added getUrl() method in Request interface that returns URL without query params
  • We updated core-interfaces-java and okhttp-client-adapter package versions

Why

The following changes were made to make the Java logging use structured logging and improve user experience.

Type of change

Select multiple if applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Dependency Change

Updated core-interfaces-java and okhttp-client-adapter package versions

Breaking change

Updated ApiLoggingConfiguration

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

hamzamahmood and others added 30 commits April 9, 2024 01:30
- inject api logger into the global config
- add mdc for request and response logging
- refactor httpLogger to remove unused logic
- move executeAsync request and response logging into AsyncExecutor
add loggingProvider logger implementation &
pass loggerConfig instead of logger instance in global config
fix test cases &
rename HttpLogger with SdkLogger
Comment thread src/main/java/io/apimatic/core/logger/LoggerUtilities.java Outdated
Comment thread src/main/java/io/apimatic/core/logger/SdkLogger.java Outdated
simplify the loggingConfiguration request and resposne body and header
Comment thread README.md Outdated
Comment thread src/main/java/io/apimatic/core/logger/LoggerUtilities.java Outdated
hamzamahmood and others added 2 commits April 23, 2024 12:20
fix method formatting in LoggerUtilities &
fix SdkLoggingFactory name and link from README.md
sufyankhanrao
sufyankhanrao previously approved these changes Apr 23, 2024
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
23 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sufyankhanrao sufyankhanrao merged commit 67d9f97 into main Apr 23, 2024
@sufyankhanrao sufyankhanrao deleted the poc-logging branch April 23, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants