Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

How to check is session is available/configured #108

Closed
304NotModified opened this issue Apr 15, 2016 · 2 comments
Closed

How to check is session is available/configured #108

304NotModified opened this issue Apr 15, 2016 · 2 comments

Comments

@304NotModified
Copy link

304NotModified commented Apr 15, 2016

With NLog users can log session values (e.g. to file).

In ASP.NET4 this works well, but with this library we have the following issues:

How do we check (without writing a log message) if the session is available/configured, so that we can prevent these issues?

Related #99, https://github.com/NLog/NLog.Extensions.Logging/issues/28

@Tratcher
Copy link
Member

To see if it's enabled you can check if context.Features.Get<ISessionFeature>()?.Session != null.

@304NotModified
Copy link
Author

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants