Skip to content

Conversation

@nanny07
Copy link

@nanny07 nanny07 commented Jun 26, 2025

Summary

This PR introduces the ability to add dynamic suffixes to MongoDB database name and/or collection names in the NLog.Mongo target, enabling more flexible log organization and partitioning strategies (ex. multi tenants)

Changes Made

  • Added databaseSuffixProperty and collectionSuffixProperty to MongoTarget to identify which bson property needs to be read to get the suffix.
  • Updated the collection and database's resolution based on the properties above
  • Updated tests to validate suffix functionality and to show how to configure the property

Fully backward compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant