|
1 |
'''[wiki:GraspExtrasOperations Extras: Log System]''' |
|
2 |
|
|
3 |
[[TracNav(GraspExtrasContents)]] |
|
4 |
|
|
5 |
The '''cfhtlog''' service provides a permanent (on-disk) circular buffer of recent log messages. A tool called '''roll''' allows you to view the log and C API calls from '''libcfht''' allow programs to log messages. If compiled with the appropriate options, '''director''' will also save all of its log messages to the roll buffer. Without this, log messages displayed in director are only kept in shared memory. |
|
6 |
|
|
7 |
== Start the log service == |
|
8 |
|
|
9 |
The first step for setting up a machine to support '''cfhtlog''' is to add the following in rc.local: |
|
10 |
|
|
11 |
{{{ |
|
12 |
# rc.local |
|
13 |
[ . . . ] |
|
14 |
|
|
15 |
# CFHT LOG SYSTEM |
|
16 |
# =============== |
|
17 |
export CFHTLOGU= |
|
18 |
export CFHTLOGS=/tmp/cfhtlog.np |
|
19 |
/gpc/bin/roll -s 500000000 -p $CFHTLOGS /gpc/conf/syslog.@ |
|
20 |
/gpc/bin/cfht_log reboot START "logging system started by $0" |
|
21 |
}}} |
|
22 |
|
|
23 |
After add those commands to rc.local, run them manually (or reboot.) '''Warning: The first time you run roll -s to create the buffer on disk, it can take several minutes.''' |
|
24 |
|
|
25 |
== Rebuild "director" with cfht_log == |
|
26 |
|
|
27 |
In the source tree, edit '''cli/director/Makefile''' and add a section the hostname: |
|
28 |
|
|
29 |
{{{ |
|
30 |
ifeq ($(HOSTNAME), insert.your.full.hostname.here) |
|
31 |
NO_CFHTLOG:= |
|
32 |
endif |
|
33 |
}}} |
|
34 |
|
|
35 |
Note that this is setting the NO_CFHTLOG variable to (empty) which turns '''ON''' the logging feature. |
|
36 |
|
|
37 |
{{{ |
|
38 |
cd cli/director |
|
39 |
make clean ; make install |
|
40 |
}}} |
|
41 |
|
|
42 |
Reboot or re-start director. |
|
43 |
|
|
44 |
== Viewing the Log == |
|
45 |
|
|
46 |
This displays the last 5 hours of log messages: |
|
47 |
|
|
48 |
{{{ |
|
49 |
/gpc/bin/roll -u -CF -h 5 | less |
|
50 |
}}} |
|
51 |
|
|
52 |
For more information, see the man page: |
|
53 |
|
|
54 |
{{{ |
|
55 |
man /gpc/man/man1/roll.1 |
|
56 |
}}} |