Cyc Logging

From Public Domain Knowledge Bank
Jump to: navigation, search

Web Browsing, I found this information at stack overflow

http://stackoverflow.com/questions/36726262/exception-for-the-log-settings-while-starting-cyc-instance

Exception for the log settings while starting CYC instance

I have been trying to get the logging working on cyc server side for any interaction with the clients(api/cycKB browser)....havn't been successful yet..

Here is the exception i get...Not sure what is wrong with json file (log4j2.json) http://pastebin.com/2CJJEbDB (Log contents)

Here are the contents of log4j2.json file http://pastebin.com/MKZA0R3d

Can someone point our the mistake here?

opencyc edited Apr 26 at 16:47 asked Apr 19 at 18:11

Arvind Upadhyay

Sadly, log4j2 doesn't control all the logging in the Cyc server.

I just tried this method out, and it works pretty well:

If you're trying to observe the traffic between the application and the Cyc server, you can get a log of all the activity that goes through the binary CFASL port (the one used by the APIs).

To turn on API logging, do the following:

Set the task-processor logging level:

(set-task-processor-verbosity 2)

Tell it where to log:

To log to a file, evaluate the following, with a path that makes sense for your install (i.e. one that the server process will have write privileges for):

(clet ((path (format-nil "/home/USER/cyc-api-~A.log" (cyc-image-id))))
  (set-tpool-background-msg-path path))

To log to the Cyc server console, evaluate this code:

(csetq *tpool-background-msg-stream* *standard-output*)

Any of this code can be evaluated automatically at startup by putting it in the file init/release-specific-init.lisp

Alternatively, these forms can be evaluated at run-time from the console or from the SubL Interactor (a tool in the Cyc browser). You can also re-evaluate any of this code at run-time for immediate changes to the logging.

Note that the task-processors run asynchronously, so you'll see one entry for the request, and another entry in the log for the response. They can be matched up by looking at the request IDs.

edited Apr 26 at 15:19 answered Apr 21 at 16:28 DaveS

From the subL-inspector, i tried the following

(set-task-processor-verbosity 2)

(clet (
         (path (format-nil
                       "/home/aupa12/cyclogs/cyc-api-~A.log"
                       (cyc-image-id)
               )
         )
      ) 
         (set-tpool-background-msg-path path)
)

But i still don't see the logging in the file when i query cyc via browser...I need to look at the logs for both cycBrowser interaction and api interaction so that i can compare and correct stuff accordingly. – Arvind Upadhyay Apr 26 at 16:23

From the error it seems log4j thinks you file contains XML, probably because there is a comma in the name.

answered Apr 20 at 1:32 rgoers


quick q..Where do you see comma? – Arvind Upadhyay Apr 26 at 16:23

You can enable browser logging to standard output (the console) via setting *MONITOR-HTML-ACTION* to t.

e.g.

(csetq *MONITOR-HTML-ACTION* t)

Evaluating this at the prompt, SubL Interactor or placing this in a system initialization file will log the URL portion of each HTTP request to standard output

answered Apr 26 at 20:57 Chris