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 disabled by default but are configurable.
<add key="NCacheServer.LogClientEvents" value="false"/>
There are multiple levels of events that are logged into Windows Logs. They are as follows:
- ERROR: Only log the errors.
- WARNING: Errors and Warnings will be logged.
- All: Logs 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 the following four options. These counters help find and control the 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 the cache after the provided interval.
The EnableCacheLastAccessCount
allows you to enable or disable the logging of the DataLastAccessCount. By default, its value is false.
<add key="NCacheServer.EnableCacheLastAccessCount" value="false"/>
The EnableCacheLastAccessCountLogging
enables the logging of keys into a log file that is created under the logs folder. Keys would only be logged if the NCacheServer.EnableCacheLastAccessCount
is set to 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 the 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 the NCacheServer.EnableCacheLastAccessCount
has been marked as true.
<add key="NCacheServer.CacheLastAccessCountInterval" value="10"/>
Another setting in the logging-config
is EnableCacheLastAccessCountLogging
, which allows logging in multiple intervals. Its value is the number of clean intervals after which keys should be logged into the file. The Clean Interval is specified under Cache's Policies tab. If the value of this variable is 4 and the clean interval is 15 seconds, logging would be triggered after every 60 seconds.
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 to true.NCacheServer.EnableCacheLastAccessCountLogging
is set to true.
<add key="NCacheServer.CacheLastAccessLogInterval" value="40"/>