How can we write the JavaScript info and error messages to the log file using log4j.
Please find the code below
<script type="text/javascript" src="././scripts/log4javascript.js"></script>
<script type="text/javascript">
var log = log4javascript.getDefaultLogger();
log.removeAllAppenders();
log.addAppender("start logging");
</script>
function writetoLog()
{
log.info("Start the Script Log..");
}
<body onload="writetoLog();">Some html code here </body>
This info messages is not write to the my log file.
Please suggest
You need to create an
AjaxAppender. It's covered in the documentation of log4javascript (for example, in the quick start tutorial: http://log4javascript.org/docs/quickstart.html).