Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output log with JSON format in default #374

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

crazytaxii
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Print log with JSON format in default for log collection, and it can be set by config file also:

default:
  log_format: json # or 'text'

Now support 2 log format:

  1. json (default)

    {"client_ip":"127.0.0.1","latency":"639µs","level":"info","method":"GET","msg":"SUCCESS","request_id":"20240415121305-030470","status_code":200,"time":"2024-04-15T12:13:05.383647879-04:00","uri":"/pixiu/tenants/1"}
    
  2. text (optional)

    INFO[2024-04-15T12:15:08.199096253-04:00] SUCCESS                                       client_ip=127.0.0.1 latency="755µs" method=GET request_id=20240415121508-615041 status_code=200 uri=/pixiu/tenants/1
    

Does this PR introduce a user-facing change?

NONE

@crazytaxii crazytaxii force-pushed the feat branch 2 times, most recently from 5d7f27a to 717c1c5 Compare April 15, 2024 16:38
Copy link
Owner

@caoyingjunz caoyingjunz left a comment

Choose a reason for hiding this comment

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

lgtm,thanks

@caoyingjunz caoyingjunz merged commit 96a5541 into caoyingjunz:master Apr 23, 2024
2 checks passed
@crazytaxii crazytaxii deleted the feat branch April 23, 2024 06:21
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.

2 participants