NLog.Mongo
NLog.Mongo copied to clipboard
User Admin
Hi, What permissions does the user need in order to write to the log? It seems that in order to write to the log there is a need to use admin rights on the whole mongo instance. Anything less than that would not write to logs to the mongodb
Know nothing about MongoDb. But I guess if you create user with the builtin role readWriteAnyDatabase
then it should work:
https://docs.mongodb.com/manual/reference/built-in-roles/#readWriteAnyDatabase
You can perform a grantRole
-action for the user:
https://docs.mongodb.com/manual/tutorial/manage-users-and-roles/#modify-access-for-an-existing-user
But why should it have read write to all databases? It should have read write only for the logging database
I just tried to answer the question whether it only works as admin. I bet if you look in the MongoDb manual then you can find a much better answer than mine.