Setup Document For Insertion Of Logs

From Znode Knowledge Base
Jump to: navigation, search

Real-Time setup

How to setup real-time log insertion in Znode?
  1. Uncomment appropriate appender-ref in Log4Net.config file under <root> tag
  2. Comment appender-ref of BufferingForwardingAppender in Log4Net.config file under <root> tag

For Ex :- uncomment <appender-ref ref="MongoDBAppender"/> under <root> tag in log4net.config and comment out <appender-ref ref="BufferingForwardingAppender"/> line under <root> to perform real time logging in mongo


Batch logging setup

How to setup log insertion in batches in Znode?
  1. Uncomment appender-ref of BufferingForwardingAppender in Log4Net.config file under <root> tag.
  2. Add appropriate appender-ref in the “BufferingForwardingAppender” appender tag and set bufferSize. Multiple appender-ref can be added in “BufferingForwardingAppender”.

For Ex :- uncomment <appender-ref ref="BufferingForwardingAppender"/> and comment <appender-ref ref="MongoDBAppender"/> lines under <root> tag. Add <appender-ref ref='MongoDBAppender'/> line in appender named as “BufferingForwardingAppender” and set buffer size. These steps will perform batch logging in mongodb as MongoDBAppender mentioned in appender.

Important to note:

  1. Logs might insert after buffer size reach of API, Admin and Webstore respectively.
  2. To check real-time issues user can set real-time logging.
  3. Users can set all Trace Levels to reach buffer size quickly.


Note: Developers can set multiple appenders to perform batch logging.


Limitations:

  1. Users cannot see logs after the log statement is executed if batch logging is enabled.
  2. All logs in memory will be lost If the application pool is restarted and the user will not find any logs which will be inserted after buffer size reached.
  3. Users can see logs only after log buffer size reaches out.

Notes:
1. A developer can set real-time logging and batch logging at a time.
2. A developer can add multiple appender-ref to log in batch in the appender tag.