Developer Forum »
Writing to a WAF log
36 posts

Hi devs!

 I tried to create a new log file in existing webnodes app. I simply used a new log name and called:

 WAF.Data.WAFLog.Insert(logName, errorMessage);

 and there is no result. I guess I should first create a log with that name, then write to it. Is there a common place where such logs are created? What’s the suggest approach here?

120 posts

The first time you call the API the system will automatically create a folder for the log files and create a reference to this in webnodes. Once this is done you need to go into the systems module and enable the logging. See enclosed picture:

 

Attachments
12 posts

Hi, 

To anyone coming here having issues with their newly created log node not being written to:

Simply activating the log node is not enough, you also need to put a maximum file size for the log to be written to on the settings page of the log node. 

If "Size limit in MB" is set to 0 (which might imply an unlimited sized log), the log simply isn't written to.

 

181 posts

When we launched the VS plugin for the ontology module, there was a lot of changes around defaults, and one bug that appeared was that new logs get a size of 0MB, so it had to be set to a value before it started working. We have fixed this in the next build of Webnodes.

 

Vidar

1