Supervisor collects data from the STDOUT and
STDERR file descriptors from the processes that it is
controlling. This data can be read through the API.
supervisor.readProcessStdoutLog(namespec, offset, length)
Table 2.33. supervisor.readProcessStdoutLog() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
| integer | offset | Character offset to read from, with 0 being the first character of the log. See table below. |
| integer | length | Number of characters to read, or zero for all characters past the offset. See table below. |
Table 2.34. supervisor.readProcessStdoutLog() Return Value
| Type | Description |
|---|---|
| string | Excerpt from the log of the process |
This method returns characters from a process' STDOUT log.
It can either return the entire log, a number of characters from the
tail of the log, or a slice of the log specified by offset and length:
Table 2.35. supervisor.readProcessLog() Offset and Length
| offset | length | Behavior of supervisor.readProcessStdoutLog() |
|---|---|---|
| Negative | Not Zero |
Bad arguments. This will raise the fault BAD_ARGUMENTS.
|
| Negative | Zero |
This will return the tail of the log, or offset
number of characters from the end of the log. For example,
if offset = -4 and length = 0,
then the last four characters will be returned from the end
of the log.
|
| Zero or Positive | Negative |
Bad arguments. This will raise the fault BAD_ARGUMENTS.
|
| Zero or Positive | Zero | All characters will be returned from the offset specified. |
| Zero or Positive | Positive |
A number of characters length will be returned from the offset.
|
If the log is empty and the entire log is requested, an empty string is returned.
If either offset or length is out of range,
the fault BAD_ARGUMENTS will be returned.
If the log cannot be read (e.g. disk error), the fault FAILED
will be returned.
![]() |
Note |
|---|---|
The |
supervisor.readProcessStdoutLog(namespec, offset, length)
This method has the same behavior as supervisor.readProcessStdoutLog() except
that it reads the log for the process' STDERR file descriptor.
supervisor.clearProcessLogs(namespec)
Table 2.36. supervisor.clearProcessLogs() Parameters
| Type | Name | Description |
|---|---|---|
| string | namespec | Name of the group and process |
This method clears the process’ STDOUT &
STDERR logs (erases all content).
If the logs cannot be cleared, the fault FAILED
will be returned.
supervisor.clearAllProcessLogs()
This method clears that STDOUT and
STDERR logs of all processes under Supervisor's control.
If the logs cannot be cleared, the fault FAILED
will be returned.

![[Note]](images/note.png)