LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

REST Web Service: niembeddedws.conf and logging

Where are the configuration options documented for the niembeddedws.conf file?  Specifically, I want to turn on the web server's logging and specify the log file.

 

Here is my niembeddedws.conf file.  The three commented out fields are my best guesses...but they did not work.

 

# Web server configuration file.
# Generated by LabVIEW 13.0f2
# 2/5/2014 10:44:00 AM

#
# Global Directives
#
#ErrorLog "$LVSERVER_ROOT/logs/error.log"
#AccessLog "$LVSERVER_ROOT/logs/access.log"
#LogLevel 3
NI.AddLVRouteVars
TypesConfig "$LVSERVER_ROOT/mime.types"
LimitWorkers 10
LimitRequestBody 50000000
LoadModulePath $LVSERVER_ROOT/modules;$LVSERVER_ROOT/..
LoadModule niSessionManagerModule mod_nisessmgr
LoadModule niAuthModule mod_niauth
LoadModule EspModule mod_niesp
LoadModule WSRuntime ws_runtime
Listen 8099

#
# Directives that apply to the default server
#
NI.ServerName "LV Embedded Web Server"
DocumentRoot "$LVSERVER_ROOT/ws_www"
InactivityTimeout 60
SetConnector netConnector
AddHandler niAuthHandler
AddHandler WSRuntime
AddHandler fileHandler ""
AddOutputFilter chunkFilter
LimitRequestForm 50000000
NI.WSRuntime.Configuration embedded "$LVSERVER_ROOT/services"
NI.WSRuntime.LoadWebService driver_interface.lvws

0 Kudos
Message 1 of 4
(3,307 Views)

Hi Darshan,

 

To turn on error loggin you will have to remove the # infront of the fist line in your conf file and add ",level=2".  Below is what my line looks like:

 

ErrorLog "$LVSERVER_ROOT/logs/error.log", level=2

 

This will create a log file next to your web server called error.log.  The log will give you information basic log information, mostly set up and some warnings.  If you would like a higher level of logging you can increase the level up to 9 and that will give you a lot of information.  I recomend staying around the 2 and 3 area or else it is hard to parse any useful information out of the log.  

 

Hope this helps!

 

KiraT

0 Kudos
Message 2 of 4
(3,292 Views)

Thanks Kira for your help here.  I was running into a problem with the previous settings, which is why I commented them out guessing that they were not right.  Since you confirmed that these are indeed the correct settings, I experimented some more.  These settings work correctly:

 

ErrorLog "error.log"
AccessLog "access.log"

 

I will see an error.log and access.log file created in the current working directory (which is the same directory from which the .exe launched).

 

The "LogLevel" is an unknown directive.  Also the "level=2" does not work (raises an error in the error.log).

 

Is there a place where all these niembeddedws.conf settings are documented?

0 Kudos
Message 3 of 4
(3,287 Views)

You can find more information on turning on Web Server error logging in this KnowledgeBase article. Were you able to get the error logging working with your web service?

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 4 of 4
(3,216 Views)