mthenw / frontail Goto Github PK
View Code? Open in Web Editor NEW๐ streaming logs to the browser. Sponsored by https://cloudash.dev
Home Page: https://cloudash.dev
License: MIT License
๐ streaming logs to the browser. Sponsored by https://cloudash.dev
Home Page: https://cloudash.dev
License: MIT License
In the project README under Usage the option -h
is listed as an alias for both --help
and --host
. When I run frontail -h
it seems to actually refer to --host
:
error: option `-h, --host <host>' argument missing
Also, running frontail --help
lists the same thing:
Usage: frontail [options] [file ...]
Options:
-h, --help output usage information
...
-h, --host <host> listening host, default 0.0.0.0
...
Anyway, not a huge deal, but I just thought I'd mention it.
Is it possible to proxy via nginx to a specific path - http://myserver/tail? I can only seem to get working at root context.
An example would be great, if available.
node -v
v0.12.13
What do you think about maybe having options to override the index.html and the css (essentially adding a new "theme" I suppose)
Rather than having to download the code, make my changes, and install my copy, it would be neat to just use the latest and greatest, but pass in my html and css changes.
Hi
We are using your project to tail some logs for our development purposes, involving Docker-based containerization.
We just want to let you guys know that we have created a public Docker image on Docker hub if anyone else is planning to use it.
Currently there is no option to get child process pid from forever. foreversd/forever#389 could help.
Marked logs while scrolling window should stick to top bar and should not be deleted when browser lines limit is reached.
Hi, first of all, thanks for this really cool tool! It is exactly what I need to share some server logs.
For that, I tried the SSH configuration with daemonize enabled, but it does not work for me, it's always using the false branch on tail.js (local execution).
This is the command I execute:
frontail --remote-host REMOTE_IP --remote-user REMOTE_USER -p 7777 -n 50 --ui-highlight default.json -d --log-path /tmp/frontail.log REMOTE_PATH_TO_MY_LOG
Adding this trace:
console.log("SSH OPTIONS: " + program.remoteHost + " - " + program.remoteUser + " - " + program.remotePort);
it returns "SSH OPTIONS: null - root - 22", although I passed the variables
On the other hand, removing the daemonize commands, it works as expected.
I believe that the sshOptions variable is not set when daemonizing the program. I'd try to fix it by myself, but I'm not a node expert :S
Thanks!
Setting username and password with parameters
frontail --auth-name username --auth-password password ...
Hi,
This is a great solution and I would really like it to work. I am more than likely making a 101 error so please excuse my ignorance. When I start up as a daemon this is my PID info :
/usr/bin/node /usr/lib/node_modules/frontail/index.js -p 9001 -n 10 -l 2000 -t default /var/log/messages
But when I go to the server on port 9001 I pretty much get a blank page and do not see the log file specified.
Could you please let me know what I am missing.
Thanks
Currently have an issue where if I follow nginx logs (which is reverse-proxying frontail), it seems like there is a positive-feedback effect happening where frontail polls after each new log event, which generates a nginx log event, which in turn causes frontail to poll again faster and faster, until I'm seeing well over 50 requests per second.
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067224 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067254 HTTP/1.1" 200 320 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067297 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067326 HTTP/1.1" 200 322 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067356 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067399 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067428 HTTP/1.1" 200 322 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067458 HTTP/1.1" 200 320 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067502 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067531 HTTP/1.1" 200 320 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067560 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067604 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067634 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067663 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067707 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067736 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
x.x.x.x - example [25/Nov/2014:05:57:47 +0000] "GET /socket.io/1/xhr-polling/HIHz5d0gC9QFQKfFhm-7?t=1416895067768 HTTP/1.1" 200 321 "https://logger-dev.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36"
Hi
I am looking for any documentation on the usage of frontail or sample code.
if you can share that would be great !!
Thanks
Hello, and thank you for frontail.
I'm trying to set up https. When I try to start a daemon I get this err:
_tls_common.js:108
c.context.setKey(options.key);
^
Error: error:0906A068:PEM routines:PEM_do_header:bad password read
at Error (native)
at Object.createSecureContext (_tls_common.js:108:19)
at Server (_tls_wrap.js:596:25)
at new Server (https.js:36:14)
at Object.exports.createServer (https.js:56:10)
at ServerBuilder.build (../node_modules/frontail/lib/server_builder.js:18:22)
at Object. (../node_modules/frontail/index.js:60:10)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
My certificates are not self-signed, but come from an authorized certificate provider. These are the key and certificate files as used by my Apache web server. Can these be inputs? I'm not sure how to deal with the password, unless that's my key passphrase.
SSLEngine on
SSLCertificateFile <path>/ssl/certs/dev.crt
SSLCertificateKeyFile <path>/ssl/certs/dev_private.key
SSLCertificateChainFile <path>/ssl/certs/intermediate.crt
Thanks, Mike
Was there intent to support this?
(ve)cblakkan ~$ ls -l a b
-rw-r--r-- 1 cblakkan staff 20B Mar 26 12:04 a
-rw-r--r-- 1 cblakkan staff 5B Mar 26 12:00 b
(ve)cblakkan ~$ frontail a b
tail: a,b: No such file or directory
I would like to filter out results by predefined patters.
I.e. while tailing syslog, I dont need information about dhclient ip renewal.
It prints some empty lines after the log file stops growing for a while.
Hello,
Thanks for the handy and simple tool. Wanting to report a potential issue as didn't see similar report yet. Can't run as daemon mode:
root@server:/tmp# frontail -p 6000 -n 100 -l 2000 /var/log/apache2/error.log & (ok)
root@server:/tmp# frontail --daemonize --pid-path /tmp/frontail.pid --log-path /tmp/frontail.log -p 6000 -n 100 -l 2000 /var/log/path/logfile.log ( fails )
/usr/local/lib/node_modules/frontail/node_modules/daemon/index.js:48
child.unref();
^
TypeError: Object # has no method 'unref'
at Function.daemon (/usr/local/lib/node_modules/frontail/node_modules/daemon/index.js:48:11)
at Object. (/usr/local/lib/node_modules/frontail/lib/frontail.js:62:23)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (/usr/local/lib/node_modules/frontail/bin/frontail:2:1)
at Module._compile (module.js:446:26)
Software ver: 0.4.1
OS: Ubuntu 12.04.2 LTS
I tried the following
node /usr/local/nvm/v0.6.16/bin/frontail /var/log/php_errors.log /var/log/apache2/error.log
And can see the resulting tail command in my ps
tail -F /var/log/php_errors.log /var/log/apache2/error.log
But I am getting nothing in the browser when I browse to port 9001
If I tail just one file it works great.
C:\wildfly\domain\servers\xyz\log>frontail .\server.log
tail: invalid option -- F
Try `tail --help' for more information.
C:\wildfly\domain\servers\claire1\log>tail --version
tail (GNU textutils) 2.0
Written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering.
Copyright (C) 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
From the newer, v2.1 tail docs:
Mandatory arguments to long options are mandatory for short options
too.
--retry
keep trying to open a file even if it is inaccessible when tail
starts or if it becomes inaccessible later; useful when follow-
ing by name, i.e., with --follow=name
-c, --bytes=N
output the last N bytes
-f, --follow[={name|descriptor}]
output appended data as the file grows; -f, --follow, and --fol-
low=descriptor are equivalent
-F same as --follow=name --retry
Recommendation is to use --follow=name --retry
vice -F
to support these versions, if practicable.
Would it be possible to change the file being watched from the front end?
IE I have a drive with hundreds of logfiles that are constantly being written to and new ones created constantly. I'd like to be able to feed an argument when landing on frontail page to select the file to be tailed:
http://localhost:9001/mydir/myfile.log
Would that be possible, without spawning a new instance of frontail for each file to be watched?
Thanks,
james
.
did ./preset/defatult.json support regex for maching word ?
Help states to use option --log-path , but it really just wants the name of the logfile to tail without --log-path and will not launch if --log-path is used.
Incorrect: frontail --log-path something
Correct: frontail something
...
Here is the daemon command
/usr/bin/nodejs /usr/local/lib/node_modules/frontail/index.js -h 0.0.0.0 -p 9999 -n 100 -l 2000 -t default -U *** -P *** ../server/log/production.log
It is showing only 10 previous lines.
first of all - great script!
if I run frontail with -d param. How do I stop it?
Getting Failed to load resource: Could not connect to the server. http://localhost:9001/socket.io/1/?t=1447090642687
in the console log of the web interface.
I ran $ npm install frontail -g
and then $ frontail output.log
(output.log does exist in the directory I was in)
I see the web UI in the browser. However, any updates to the log do not show up in the web UI automatically, as I was expecting them to. After looking at the console log in the browser, I saw the error referenced above.
Is there another setup step that isn't documented that I need to know?
Hi,
A feature is missing for me : the ability to ignore some lines matching a pattern.
Just a proposition, this tools is already very awesome, thanks for your job.
Have a good day.
C:\somepath>frontail --ui-highlight 2016-01-29T10-46-56-server-access.log.2016-01-29
module.js:339
throw err;
^
Error: Cannot find module 'C:\somepath\preset\default.json'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Program Files\nodejs\node_modules\frontail\index.js:89:27)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
Provide new parameter, which will cause asking user for private key passphrase while starting https server.
Related to #40.
/local/bin/frontail --host development.web.com --port 8181 --pid-path '/pub/node/frontail.8181.pid' --key '/local/ssl/certs/new_dev_private.key' --certificate '/local/ssl/certs/upstartdev.crt' --log-path /pub/node/frontail.log --daemonize --ui-highlight /local/lib/node_modules/frontail/preset/default.json /tmp/front1
The server starts but --ui-highlight does not work. If I remove --daemonize or -d the --ui-highlight works fine as specified above with full path to json file
/local/bin/frontail --host development.web.com --port 8181 --pid-path '/pub/node/frontail.8181.pid' --key '/local/ssl/certs/dev_private.key' --certificate '/local/ssl/certs/dev.crt' --log-path /pub/node/frontail.log --ui-highlight /tmp/front1
Arguments needed, use --help
If I leave off --ui-highlight all together there is no highlighting - not picking up defaults. The daemonize option is not specified.
My --ui-highlight input file works:
{
"words": {
"err": "color: red;"
},
"lines": {
"err": "font-weight: bold; background-color: yellow;"
}
}
/local/bin/frontail --host development.web.com --ui-highlight --port 8181 --pid-path '/pub/node/frontail.8181.pid' --key '/local/ssl/certs/dev_private.key' --certificate '/local/ssl/certs/dev.crt' --log-path /pub/node/frontail.log /tmp/front1
Thank you for looking. Mike
I'm looking to be able to have multiple highlight options in a single log stream.
I've tried writing my default.json in several formats but can only get, at most, one highlight working at a time.
An example of what I've tried
{
"words": {
"HIT": "color: green;"
"MISS": "color: red;"
}
}
I suspect I'm missing something simple. Can you point me in the right direction?
Thanks!
I'm trying launch frontail with uwsgi emperor. Vassal ini contain string
attach-daemon = frontail /home/vagrant/log/uwsgi-error.log
or
attach-daemon = /usr/bin/nodejs /usr/local/lib/node_modules/frontail/index.js /home/vagrant/log/uwsgi-error.log
with following error in uwsgi log (no matter which string):
[uwsgi-daemons] respawning "/usr/bin/nodejs /usr/local/lib/node_modules/frontail/index.js /home/vagrant/log/uwsgi-error.log" (uid: 1000 gid: 1000)
Error: Implement me. Unknown stream file type!
at createWritableStdioStream (node.js:597:15)
at process.stderr (node.js:628:16)
at Object.<anonymous> (/usr/local/lib/node_modules/frontail/node_modules/connect/node_modules/debug/node.js:37:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/usr/local/lib/node_modules/frontail/node_modules/connect/lib/proto.js:14:13)
When I run frontail from command line, all working ok.
How to do it in right way?
I have an existing website that I'd like to be able to show log file output in. Instead of linking to the frontail index.html
, how can I configure frontail to work with my own website/view?
I started poking around and I copied over the app.js
and socket.io.js
into my own website, started the frontail service as a daemon, and tried launching my site. I get the following error in the console...
For testing purposes I went into the socket.io.js
and hardcoded all of the port
options to 9001 and the error went away and no new errors showed up. However, I'm noticing the __NAMESPACE__
placeholder isn't being set in my website. It does get set properly in the frontail index.html site. What sets this variable and how can I hook it up to my site?
Hi,
I want to use your tool for my servers with docker, As I run the same with default conf, like with syslog it is working fine. But I want to run with my custom logs files. but with the same it is not working for me. Please find what I am doing to see my nginx logs in web using docker.
docker run -d -v /var/log/nginx/access.log:/nginx-access -P mthenw/frontail /nginx-access
when I check with "docker ps -a"
I got exited
Please help.
Thanks
Feature request for listen ip address 1.2.3.4
For example I can tail some log file and look for a specific token "ERROR" which i would like to be shown as red, and DEBUG: which would be say green...
It would be nice to have some extra function before sending the line to grep for a tag/word and apply a colour to the whole line.
I have a script that streams with frontail on a port, when it's complete, I allow someone else to stream a file on that same port (now that it's available). If the first person doesn't close their browser, they can now see a stream of the 2nd person's file. Any idea how to circumvent this?
Can we get HTTPS support for this? I think it's a great web application and we'd like to use it here at NASA, but we can only use it if it allows HTTPS.
Please add possibility to use login/password.
Thx!
When text to display is too long for one line it is moved to second one. But there is some padding added to the left side that makes it look strange especially when there is only few letters left.
Frontend should store fixed number (set on startup) of logs and remove old while new arrives.
frontail -l 1000 /var/log/syslog
Do you have an example for this? The doc is not clear at all.
[file ...] means what? Exactly?
Hi. Thank you for sharing your great project.
I'd like to use this behind a reverse proxy. But it seems to have a problem.
Then the program works but image/css would be not found because they aren't in there.
Here are an example of setting of apache.
<VirtualHost *:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName hs.kc.jp
ServerAlias example.com
ServerName example.com
ServerAlias example.com
ProxyPass /frontail http://localhost:9001/
ProxyPassReverse /frontail http://localhost:9001/
</VirtualHost>
I'm not sure how I could solve this.
Could you give me a hint? I want to send PR if I can(though I'm not a developer of npm...).
Great little project this is.
I'd like to use this for a rotating log system I have. Unfortunately the file names keep changes due to the rotating nature of the system. Therefore it would be useful if I could specify a folder to monitor, and then when I visit the site it would show me all available files within this folder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.