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

Can make the ratelimit log print to a file? #579

Open
ningyougang opened this issue May 11, 2024 · 0 comments
Open

Can make the ratelimit log print to a file? #579

ningyougang opened this issue May 11, 2024 · 0 comments

Comments

@ningyougang
Copy link

  • Can make the ratelimit log output to a file?

    Currently, as for as i know, the ratelimit's log just print to standard output, can we make the log print to a file(e.g. /var/log/ratelimit.log)?

  • Can change the log filed?

    As for as know, there has several environments to control the LOG, e.g

    env:
    - name: LOG_FORMAT
       value: text|json
    - name: LOG_LEVEL
       value: info|warn
    

    if configure with LOG_FORMAT: text, the log's content as below

    time="2020-09-10T17:22:35Z" level=debug msg="loading domain: messaging"
    time="2020-09-10T17:22:35Z" level=debug msg="loading descriptor: key=messaging.message_type_marketing"
    time="2020-09-10T17:22:35Z" level=debug msg="loading descriptor: key=messaging.message_type_marketing.to_number ratelimit={requests_per_unit=5, unit=DAY}"
    time="2020-09-10T17:22:35Z" level=debug msg="loading descriptor: key=messaging.to_number ratelimit={requests_per_unit=100, unit=DAY}"
    time="2020-09-10T17:21:55Z" level=warning msg="Listening for debug on ':6070'"
    time="2020-09-10T17:21:55Z" level=warning msg="Listening for HTTP on ':8080'"
    time="2020-09-10T17:21:55Z" level=debug msg="waiting for runtime update"
    time="2020-09-10T17:21:55Z" level=warning msg="Listening for gRPC on ':8081'"
    

    can we make above log content as below?

    2020-09-10T17:22:35Z debug loading domain: messaging
    2020-09-10T17:22:35Z debug loading descriptor: key=messaging.message_type_marketing
    2020-09-10T17:22:35Z debug loading descriptor: key=messaging.message_type_marketing.to_number ratelimit={requests_per_unit=5, unit=DAY}
    2020-09-10T17:22:35Z debug loading descriptor: key=messaging.to_number ratelimit={requests_per_unit=100, unit=DAY}
    2020-09-10T17:21:55Z warning Listening for debug on ':6070'
    2020-09-10T17:21:55Z warning Listening for HTTP on ':8080'
    2020-09-10T17:21:55Z debug waiting for runtime update
    2020-09-10T17:21:55Z warning Listening for gRPC on ':8081'
    
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

No branches or pull requests

1 participant