anchor.diff:  
   ## <a id='writing'></a> Writing to the Log from Your App
   
  -Your app must write logs to `stderr` or `stdout`. Both are typically buffered, and you should flush the buffer before delivering the message to Loggregator.
  -
  -Alternatively, you can write log messages to `stderr` or `stdout` synchronously. This approach is mainly used for debugging because it may affect app performance.
  -
  +Your app must write logs to `stderr` or `stdout`. Both are typically buffered, and you should flush the buffer before
  +delivering the message to Loggregator.
  +
  +Alternatively, you can write log messages to `stderr` or `stdout` synchronously. This approach is mainly used for
  +debugging because it may affect app performance.
   
   ## <a id='container-metrics'></a> Including Container Metrics in Syslog Drains
   
  -By default, app logs are included in syslog drains. Syslog Agents forward logs to configured syslog drains and Loggregator. For more information about Syslog Agents, see [Loggregator Components](https://docs.cloudfoundry.org/loggregator/architecture.html#loggregator-components) in _Loggregator Architecture_.
  -
  +By default, app logs are included in syslog drains. Syslog Agents forward logs to configured syslog drains and
  +Loggregator. For more information about Syslog Agents, see
  +[Loggregator Architecture and Components](../../loggregator/architecture.html#components) in _Loggregator Architecture_.
   
   ## <a id='view'></a> Viewing Logs in the Command Line Interface
   
  -Use the cf CLI `cf logs` command to view logs. You can tail, dump, or filter log output. For more information about the `cf logs` command, see [cf logs](https://cli.cloudfoundry.org/en-US/cf/logs.html) in the Cloud Foundry CLI Reference Guide.
  +Use the cf CLI `cf logs` command to view logs. You can tail, dump, or filter log output. For more information about the
  + `cf logs` command, see [cf logs](https://cli.cloudfoundry.org/en-US/cf/logs.html) in the Cloud Foundry CLI Reference
  +Guide.
   
   ### <a id="tail-log"></a> Tailing Logs
   
  
positive.code: 
  ### <a id="dump-log"></a> Dumping Logs
  
  To display all the lines in the Loggregator buffer, run `cf logs APP-NAME --recent` and replace `APP-NAME` with the name of your app.
  
  ### <a id="filter"></a> Filtering Logs
  
  To view some subset of log output, run `cf logs APP-NAME` in conjunction with filtering commands of your choice. Replace `APP-NAME` with the name of your app. In the example below, `grep -v RTR` excludes all Gorouter logs:
  
  <pre class="terminal">
  $ cf logs spring-music --recent | grep -v RTR
  
negative.code: 
  Ensuring log ordering in drains can be an important consideration for both operators and developers.
  
  * Diego uses a nanosecond-based timestamp that can be ingested properly by Splunk. For more information, see
    [TIME_FORMAT and subseconds](https://answers.splunk.com/answers/1946/time-format-and-subseconds.html) in the Splunk
    documentation.
  
  * The Elastic Stack can ingest the nanosecond timestamps but only supports millisecond precision, so timestamps are
    truncated. For more information, see the
    [Date datatype](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html) in the Elasticsearch
    documentation and the
    [Date type has not enough precision for the logging use case](https://github.com/elastic/elasticsearch/issues/10005)
    GitHub issue.
  
  If you are developing a client that displays a stream of <%= vars.app_runtime_abbr %> logs to users, you can order the
  logs to improve the debugging experience for your user. The following are general tips for ordering logs:
  
  * For CLIs, batch the logs and display the logs you have in that timeframe, sorted by timestamp.
  
  * For web clients, use dynamic HTML to insert older logs into the sorting as they appear. This creates complete,
    ordered logs.
  
  * Java app developers may want to convert stack traces into a single log entity. To simplify log ordering for Java
    apps, use the multi-line Java message workaround to convert your multi-line stack traces into a single log entity.
    For more information, see
    [Multi-line Java message workaround](https://github.com/cloudfoundry/loggregator-release/blob/develop/docs/java-multi-line-work-around.md)
    in the loggregator-release repository on GitHub.
    <br><br>
    By modifying the Java log output, you can force your app to reformat stack trace messages, replacing newline
    characters with a token. Set your log parsing code to replace that token with newline characters again to display the
    logs properly in Kibana.
  