TABLE OF CONTENTS
Real-Time setup
How to setup real-time log insertion in Znode:
Uncomment appropriate appender-ref in Log4Net.config file under <root> tag
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:
Uncomment appender-ref of BufferingForwardingAppender in Log4Net.config file under <root> tag.
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:
Logs might insert after buffer size reach of API, Admin, and Webstore respectively.
To check real-time issues users can set real-time logging.
Users can set all Trace Levels to reach buffer size quickly.
Note: Developers can set multiple appenders to perform batch logging.
Limitations:
Users cannot see logs after the log statement is executed if batch logging is enabled.
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 the buffer size reached.
Users can see logs only after log buffer size reaches out.
Notes:
A developer can set real-time logging and batch logging at a time.
A developer can add multiple appender-ref to log in batch in the appender tag.