@JoDi, as you said your environment is windows and you want to --auditDestination
in 'c:\' .
As per MongoDB BOL Configure Auditing To enable auditing and print audit events to a file in JSON
format, specify file for the --auditDestination
setting, JSON
for the --auditFormat
setting, and the output filename for the --auditPath
. The --auditPath
option accepts either full path name or relative path name. For example, the following enables auditing and records audit events to a file with the relative path name of data/db/auditLog.json
:
mongod --dbpath data/db --auditDestination file --auditFormat JSON --auditPath data/db/auditLog.json
As here dbpath is C:\data\db , file is the destination file location
& AuditPath is C:\data\db\auditLog.json
You may also specify these options in the configuration file
:
storage:
dbPath: data/db
auditLog:
destination: file
format: JSON
path: data/db/auditLog.json
NOTE Printing audit events to a file in JSON format degrades server
performance more than printing to a file in BSON format.