hapijs / good

hapi process monitoring
Other
525 stars 160 forks source link

Subscribe to file rotate events (rotating-file-stream) #502

Closed sulhome closed 8 years ago

sulhome commented 8 years ago

I am using rotating-file-stream for file rotation in good.

how can I subscribe to the events emitted by rotating-file-stream?

Is there a way to get hold of the rotating-file-stream instance so I can subscribe to these events?

thank you

arb commented 8 years ago

Not really... not in a way that is documented or supported. The reporters are supposed to be sort of isolated and black-boxed.

What are you trying to do?

sulhome commented 8 years ago

I want to send log files to another location (S3 bucket) so the workflow I want to implement is like this log to file --> rotated event raised --> send this file to S3 bucket

arb commented 8 years ago

You could just log directly to the S3 bucket instead? Or do you really want to have the log file and a copy of it on S3?

sulhome commented 8 years ago

you can post files to S3 but not log entries so you can't use http or file

arb commented 8 years ago

It would probably be easier and cleaner to use another tool for this; like a cron job or something.

Alternatively, you could use something like https://github.com/Coggle/s3-streamlogger. Remember, you can use ANY stream with good now; not just the ones under the hapijs GitHub organization.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.