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

bug(log): RotatingFileHandler.log() should handle message longer than 4096 #4361

Closed
yuqiang-yuan opened this issue Feb 20, 2024 · 1 comment
Labels
bug Something isn't working log PR welcome A pull request for this issue would be welcome

Comments

@yuqiang-yuan
Copy link

yuqiang-yuan commented Feb 20, 2024

Is your feature request related to a problem? Please describe.

I'm using file_handler to log user's payload which sometimes longer than 4096 bytes. but the file_handler can not handle it correctly. the error message is:

error: Uncaught (in promise) RangeError: offset is out of bounds
    this._buf.set(bytes, this._pointer);
              ^
    at Uint8Array.set (<anonymous>)
    at RotatingFileHandler.log (https://deno.land/std@0.216.0/log/file_handler.ts:79:15)
    at RotatingFileHandler.log (https://deno.land/std@0.216.0/log/rotating_file_handler.ts:106:11)
    at RotatingFileHandler.handle (https://deno.land/std@0.216.0/log/base_handler.ts:28:10)
    at RotatingFileHandler.handle (https://deno.land/std@0.216.0/log/file_handler.ts:66:11)
    at https://deno.land/std@0.216.0/log/logger.ts:135:15

Describe the solution you'd like

I home file log handler could handle messages longer than 4096. If the message is longer than 4096, split it into chunks and then write to the log file and flush.

@iuioiua iuioiua changed the title log file_handler should handle message longer then 4096 bug(log): RotatingFileHandler.log() should handle message longer then 4096 Feb 20, 2024
@iuioiua iuioiua added bug Something isn't working log PR welcome A pull request for this issue would be welcome labels Feb 20, 2024
@yuqiang-yuan yuqiang-yuan changed the title bug(log): RotatingFileHandler.log() should handle message longer then 4096 bug(log): RotatingFileHandler.log() should handle message longer than 4096 Feb 22, 2024
@babiabeo
Copy link
Contributor

babiabeo commented Mar 7, 2024

This issue was fixed by #4415.

@iuioiua iuioiua closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working log PR welcome A pull request for this issue would be welcome
Projects
None yet
Development

No branches or pull requests

3 participants