Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log to filesystem or message queue?

To avoid a "this is an opinion-based question" complaint then I'll ask it more specifically:

"Is logging to the filesystem slower than a message queue, and is a performance bottleneck more likely with the filesystem?"

I am using honeypots in a form and will log details of any submissions caught in the trap.

I will then occasionally look at the logs and make any decisions I need to.

I won't log to the database, for me that's clearly not the best choice.

But should I use a message queue or log to the file system?

I have all the code and setup for the MQ, so that's not an issue, but I'm concerned if I'm more likely to get a bottleneck from hitting the MQ or the filesystem.

Logging to a file is unsuitable in many cases in my opinion, but because here I just need to manually glance at the data then maybe a file is the best choice?

Unlikely to make a difference, but I'm using PHP.

like image 420
user2143356 Avatar asked Aug 01 '26 18:08

user2143356


1 Answers

Logging to your filesystem will be the faster method.

Logging to any Api will cause quite a few actions to be performed, ie. load an api class, set up a connection to a socket, handshake, authenticate, send a request, parse the response etc.

Writing to your filesystem will be the fastest method by far.

like image 149
Damien Overeem Avatar answered Aug 04 '26 09:08

Damien Overeem