getserverlog
LOGS
,
RESULT
,
START
,
END

The getserverlog statement retrieves information from one or more server logs.


Parameters

This statement has four parameters:

logs – this is a slash (/) separated array specifying what logs to retrieve. The available options are share/shareerror/web/weberror/webperformance.

result – field or variable to put the result into.

start – log date to retrieve (if omitted, today’s date will be assumed).

end – last log date to retrieve (if omitted, the start date will be assumed).


Description

This statement retrieves server log information (see Logging Server Activity). For example, this code will retrieve today’s web logs.

local loglines
getserverlog "web",loglines

Note: Each line of the log is separated by a carriage return.

Important: This statement can ONLY be used on the actual server computer, it cannot be used on a client computer. It can be run on a copy of Panorama running on the server computer, or it can actually be run in a web procedure. For example, this web procedure will display the number of web errors on the users' browser.

local loglines
getserverlog "weberror",loglines
let errorCount = linecount(loglines)
cgiHTML = "There have been "+pattern(errorCount,"# web publishing error~")+" today."

Or, if used in a regular copy of Panorama runnning on the server computer, this code will import today’s performance logs into the current database for analysis. Note: The getserverlog statement will automatically flush the log caches before retrieving the log data.

local loglines
getserverlog "webperformance",loglines
importtext loglines,"ExistingData","Replace"

Usually this statement retrieves todays logs, but you can also specify a different date.

local loglines
getserverlog "webperformance",loglines,date("monday")
importtext loglines,"ExistingData","Replace"

You can also specify a range of dates. This example imports all of the performance logs for the current month.

local loglines
getserverlog "webperformance",loglines,month1st(today()),today()
importtext loglines,"ExistingData","Replace"

Finally, you can also specify multiple log types. This example imports all of the error logs (both sharing and web publishing) for the past 7 days.

local loglines
getserverlog "shareerror/weberror",loglines,today()-7,today()
importtext loglines,"ExistingData","Replace"

See Also


History

VersionStatusNotes
10.2NewNew in this version.