Logs for applications running on Stackato are aggregated into streams, so that data from multiple instances can be viewed together and filtered. Application log streams can be accessed via:
Information on system logs for Stackato itself and log aggregation settings can be found in the Log Aggregation documentation.
Log streams are tailed output from actual log files in each application container, generally found in the /app/logs/ directory. These files can be accessed with the stackato files command or from the Application details page of the Management Console.
To view and application log stream, use the stackato logs command:
$ stackato logs myapp
To limit the number of lines displayed, use the --num option:
$ stackato logs myapp --num 50
To view log stream as it is updated, use the --follow option:
$ stackato logs myapp --follow
Log streams can be filtered on a number of parameters:
The --json flag can be used to return each log line as a JSON object.
$ stackato drain add myapp appdrain udp://logs.loggly.com:12345
This creates a UDP drain called "appdrain" for the application "myapp" which forwards all log messages and events for that application to Loggly on port 12345.
To delete the drain:
$ stackato drain delete appdrain
Use the --json option send the log lines in JSON format:
$ stackato drain add myapp jsondrain --json udp://logs.loggly.com:12346
If the service at the recieving end of the drain goes offline or becomes disconnected, Stackato will retry the connection indefinitely (at increasing intervals).