We are using mongodb version 3 in a AWS environment with Linux AMIs. I suspect this is not possible from reading the mongodb documentation.
I would like to log all slow queries to its own log file. When slow queries are logged they write the query data as well. I do not want query data going into my normal mongodb.log file.
Thank you.
I don't believe it will be possible to log slow queries into a separate log file. However, depending on the intent, there may be other options to achieve a similar result.
The best course of action will depend on the goal. Is the goal to:
Access logs for slow query without having to look through a log file, or..
Prevent logs of slow queries from appearing in the logs (e.g. queries can't be present for security reasons)
For the former, look into using the Database Profiler, which can be configured to log slow queries to a system.profile collection.
For the latter, you may want to try looking into customizing the verbosity settings of your logs. It looks like it should be possible to entirely disable the logging of queries.