Closed undso closed 9 years ago
That's a tough one. Thanks for pointing it out. Do you think it's possible to change the code to properly handle the case where the key has a dot? I can't test it right now, but will take a look tonight.
If not, I'm also inclined to go with option 2.
The appender can handle the dot. The problem is the mongodb. There is a restriction field names cannot contain dots (i.e. .), dollar signs (i.e. $), or null characters. http://docs.mongodb.org/manual/reference/limits/#Restrictions on Field Names
I'll implement option 2 and create a pull request.
I get an exception in the method:
org.log4mongo.LoggingEventBsonifierImpl.addMDCInformation()
when the MDC properties has an entry where the key contains a dot.To fix this issue I see two ways: 1) Ignore properties with such a key. 2) Replace all dots with an other sign (e.g. '_')
Which way should we go? I prefer number 2, because we loose not data, but I know there can be a problem when there is another property which then has the same key.