Logging in NCache
Important
To update any cache settings, follow the steps provided in the Update Cache Config section.
Windows Event Logging
A tag that lets you enable or disable the logging of client connectivity events in the Windows logs. These events are disable by default but are configurable.
<add key="NCacheServer.LogClientEvents" value="false"/>
There are multiple level of events which are logged into Windows Logs. They are as follows:
- ERROR : Only log the errors
- WARNING : Errors and Warnings will be logged
- All : Log all events
<add key="NCacheServer.EventLogLevel" value="all"/>
Logging Sliding Expiration
To get information about the data in the cache having sliding expirations, NCache allows following four options. These counters help find and control these following tasks.
- The number of cache items that have not been accessed since the last sliding interval.
- Log all those keys that have not been accessed since the last sliding interval.
- Collect and log the above mentioned data from cache after the provided interval.
EnableCacheLastAccessCount
allows you to enable or disable the logging of the DataLastAccessCount. By default its value is false.
<add key="NCacheServer.EnableCacheLastAccessCount" value="false"/>
EnableCacheLastAccessCountLogging
enables logging of keys into a log file that is created under logs folder. Keys would only be logged if NCacheServer.EnableCacheLastAccessCount
is set "true".
<add key="NCacheServer.EnableCacheLastAccessCountLogging" value="false"/>
NCache allows you to define a time interval for all the keys that have been idle for a specific amount of time (time in minutes). For example a time interval of 30 would allow NCache server to collect all those keys that have been idle for the last 30 or more minutes. This option will only be functional if NCacheServer.EnableCacheLastAccessCount
has been marked "true".
<add key="NCacheServer.CacheLastAccessCountInterval" value="10"/>
Another setting in the logging-config
is EnableCacheLastAccessCountLogging
that allows logging in multiple intervals. Its value is the number of clean intervals after which keys should be logged into file. CleanInterval is specified under Cache's "Policies" tab. If the value of this variable is "4" and clean interval is of 15 seconds, logging would be triggered after every 60 secs.
Interval based logging does not affect NCache performance even though part of the information required by logging is collected from the core components of NCache.
This option would apply only if:
NCacheServer.EnableCacheLastAccessCount
is set "true".NCacheServer.EnableCacheLastAccessCountLogging
is set "true".
<add key="NCacheServer.CacheLastAccessLogInterval" value="40"/>