• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
Download
Show / Hide Table of Contents

Error Logging

Error logging helps diagnose cache failures, replication issues, and client-side errors in distributed environments. NCache supports Error Logs for error-level messages with minimal performance overhead and Detailed Logs for additional diagnostic messages, including warnings and debug information. Detailed logging is useful during troubleshooting but may generate more frequent log activity. Cache logs are written by default to %NCHOME%\log-files on Windows or /opt/ncache/log-files on Linux, while client logging settings are maintained on the cache server and provided to clients when they connect.

Until the client receives its logging configuration from the cache server, detailed client logs are temporarily stored in memory. Once the configuration is received, NCache handles these stored logs according to the configured logging level. If Detailed Logs are enabled, all stored logs are written. If only Error Logs are enabled, only Error-level logs are written. If client logging is disabled, the stored logs are discarded. Any client Error logs generated before the configuration is received are written to Windows Event Viewer under the NCache source when NCache is installed, or under the Application Error source otherwise.

Using the NCache Management Center

  • Launch the NCache Management Center by browsing to http://localhost:9801 or <server-ip>:9801.

  • In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to configure.

  • Against the cache name, click on View Details. NCache Management Center showing the cache list with the View Details option selected for a cache.

  • This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Options in the left bar.

  • Under Error Logging, configure the required logging options:

    • Enable error logging: Enables error logging for the cache.

    • Enable detailed error logging: Enables detailed cache logs containing additional diagnostic information. Use this option when troubleshooting cache-related issues.

    • Log File Path: Specifies a custom location for cache log files. Make sure the specified path exists on all cache server nodes.

    • Enable client error logging: Enables error logging for client applications connected to the cache. Client logs are generated in the application folder, while OutProc Client Cache logs are generated in its own folder.

    • Enable client detailed error logging: Enables detailed logging for client applications connected to the cache for additional troubleshooting information.

Note

Client logging is enabled by default. Client Cache logging follows the client logging configuration; enabling client logging also enables logging for the associated Client Cache.

Error Logging configuration page in NCache Management Center showing cache and client logging options.

  • Click Save Changes at the bottom of the page to apply the logging configuration. The logging settings are hot applicable, so a running cache does not need to be restarted.

Using PowerShell

You can configure cache and client logging using the Set-NCacheLogging cmdlet. The logging configuration is applied to all cache server nodes and is hot applicable, so a running cache does not need to be restarted. For cache logging, -Level Detail enables errors, notices, warnings, and debug information. For client logging, Detail configures debug-level logging.

This command enables detailed logging for the cache server.

Set-NCacheLogging -CacheName defaultCache -Enable true -Level Detail

This command sets cache server logging to Error level on all nodes of the defaultCache, connecting to the NCache Service on 20.200.20.11 first:

Set-NCacheLogging -CacheName defaultCache -Level Error -Server 20.200.20.11

This command enables Error-level logging for clients connected to the cache.

Set-NCacheLogging -CacheName defaultCache -Type Client -Enable true -Level Error

To disable client logging while retaining the configured log level.

Set-NCacheLogging -CacheName defaultCache -Type Client -Enable false

To set cache server logging to Error level from a machine where NCache is not installed, connecting to a server with mutual TLS (mTLS) enabled.

Set-NCacheLogging -CacheName defaultCache -Level Error -Server 20.200.20.11 -TlsCertPath "C:\certs\client.pem" -TlsCertPassword "clientKeyPassword"

The -TlsCertPath parameter specifies the client certificate used to authenticate the machine executing the cmdlet. The -TlsCertPassword parameter specifies the password required to decrypt the password-protected private key. Omit -TlsCertPassword if the private key is not encrypted.

If -Type is not specified, the logging configuration is applied to the cache server. Parameters that are not specified retain their current values.

For more information on the cmdlet and its parameters, see Set-NCacheLogging.

Manually Editing NCache Configuration

You can manually edit the NCache configuration file as explained below:

Important

Ensure the cache is stopped before making any configuration changes.

  • For Server-side Logging, enable/disable the logs through the config.ncconf by specifying the <logging> tag under the <cache-settings> tag:
<cache-settings ...>
   <logging enable-logs="True" trace-errors="True" trace-notices="False" trace-warnings="False" trace-debug="False" log-path=""/>
</cache-settings>
  • For Client-side Logging, configure the <logging> element under <client-settings> in the server-side config.ncconf. The configured logging settings are provided to clients after they connect to the cache.
<client-settings>
        <logging enable-logs="True" log-level="error"/>
        ...
</client-settings>        
  • Once the changes are made, restart the NCache Service, and then start the cache.

Enable Logging for Java Client

Logging in the NCache Java client can be controlled by setting the enableNCLogs property before initializing the cache.

System.setProperty("enableNCLogs", Level.INFO.toString());

The log file is generated in the application home directory. The above property will enable the logging of all INFO messages. It will also enable logging of SEVERE and WARNING messages. The Level class (java.util.logging) defines a set of standard logging levels that can be used to control logging output. The logging Level objects are ordered and are specified by ordered integers. Enabling logging at a given level also enables logging at all higher levels. Clients should use the predefined Level constants such as Level.SEVERE. The levels in descending order are as follows:

  • SEVERE (highest value)
  • WARNING
  • INFO
  • CONFIG
  • FINE
  • FINER
  • FINEST (lowest value) In addition, there is a level OFF that can be used to turn off logging, and a level ALL that can be used to enable logging of all messages.

See Also

Cache Settings
Cache Level Events
Eviction Policy

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top