question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote log tailing

See original GitHub issue

Imagine

sh gradlew aemTail -Paem.instance.name=int-publish -Paem.tail.name=logs/error.log

or using shorthand syntax:

sh gradlew aemTail -Paem.tail=int-publish:logs/error.log

or even if default specified as:

aem {
    config {
        tail = propParser.string("aem.tail", "int-author:logs/error.log")
        tailMaxErrors = 20
        tailMaxWarnings = 30
        /*
        tailStatus = { status-> 
            if (status.logs.filter { it.contains("error") }.isNotEmpty()  {
                status.text = "UNSTABLE"
            } else 
                status.text = "STABLE" {
            }
           def grep = propParser.string("aem.tail.grep")
           if (grep != null) {
                status.grep(grep)
           }
         }
    }
}

then just

sh gradlew aemTail

will grab logs using url http://x.x.x.x:4503/system/console/slinglog/tailer.txt?_dc=1520834477194&tail=400&name=%2Flogs%2Ferror.log

and output it interactively as aemAwait does.

it would be nice that status bar will compute some summary like below:

<-------------> 0% EXECUTING [9m 33s]
> :aem:aemTail > local-author [errors: 40, warnings: 120] - UNSTABLE
12.03.2018 06:57:02.117 *INFO* [qtp687303746-206125] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
12.03.2018 06:57:04.119 *INFO* [qtp687303746-206125] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials

UNSTABLE/STABLE displayed will depend on configured maximum error/warnings per minute rate.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mierzwidcommented, Jan 14, 2019

Additional comments:

  • this task will be added in the tooling plugin

Next steps:

  • some exceptions can be blacklisted - if they are known not harmful that are frequent in logs the plugin will ignore them
  • developer would get notified about problematic log entries from all environments after deployment, or even when clicking through one instance
    • notification in a popup, so there is no need to tail all log files from all instances
0reactions
pun-kycommented, Feb 21, 2019

released as 6.1.0-beta 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tailing log files on multiple remote machines | by Madhur
Tailing log files on multiple remote machines. Recently, our ELK infrastructure went down which aggregates log from our multiple servers.
Read more >
How can I tail a remote file? - Stack Overflow
You can Tail files remotely using bash and rsync. The following script is taken from this tutorial: Tail files remotely using bash and...
Read more >
Tailing files on remote hosts | The Logfile Navigator - Lnav
This feature allows you to view local files and files from multiple remote hosts alongside each other in the log view. The only...
Read more >
Laravel Tail can now tail remote logs - Freek.dev
To tail a remote log, you just have to add a couple of lines to your .env file. Here's an example for freek.dev...
Read more >
ukhas/js-logtail: Remote log tailing using the HTTP ... - GitHub
Ludicrously simple remote unix 'tail' like log viewer. This uses an ajax request, and the HTTP Range: header to request only the last...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found