Added support for logging nested properties of session items. - #3
Conversation
|
This is a breaking change? |
|
I guess it is. In the current version it will cause an exception and consequently won't log anything in the log. With this change it will log whatever the nested property refers too so I guess it does not do any harm. |
|
Well you can have session items with a dot? I think it should be backwards compatible. Maybe an extra boolean? Also please post an example (config, usage) thanks! |
|
Also unit test are needed. |
|
Yes, you are right, you can use dotted names and this is going to break it. Do you think it's better to add a new bool property or create a separate |
|
I prefer the first solution because the code/functionality is highly related. |
|
OK, I will work on it. Any suggestions about the boolean property name? |
|
|
|
What about evaluateNestedProperties ? |
|
EvaluateAsNestedProperties? |
|
Sounds good. |
… properties or not
|
@304NotModified Pull Request updated. |
|
Thanks! I will merge this after some unit tests and example configs. |
|
To be honest I am not sure how to mock Session. As for example configs do you want me to add it to the main Nlog project or this one? |
|
I would like a XML config example in this PR thread. For the wiki and other possible the news post. |
|
About mocking I propose to use Moq on the unit test project. |
|
@Xharze where are the unit tests located for |
|
@304NotModified Here is a sample xml configuration. To have the nested properties of session object evaluated use the following layout for AspNetSession layout renderer Where do I write tests for it? |
|
@Xharze we don;t have unit tests in this repos available ? |
|
@304NotModified Can you merge it without tests? I don't see any tests for existing code either. |
Added support for logging nested properties of session items.
|
note this has been released and documented: https://github.com/NLog/NLog/wiki/AspNetSession-layout-renderer |
No description provided.