NLog.Mongo icon indicating copy to clipboard operation
NLog.Mongo copied to clipboard

User Admin

Open naphtalidavies opened this issue 3 years ago • 3 comments

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

naphtalidavies avatar Jul 06 '20 11:07 naphtalidavies

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

snakefoot avatar Jul 06 '20 16:07 snakefoot

But why should it have read write to all databases? It should have read write only for the logging database

naphtalidavies avatar Jul 07 '20 12:07 naphtalidavies

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.

snakefoot avatar Jul 07 '20 15:07 snakefoot