<div dir="ltr">On 29 October 2014 12:13, Myles Braithwaite <span dir="ltr"><<a href="mailto:me@mylesbraithwaite.com" target="_blank">me@mylesbraithwaite.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">Dave Cramer wrote:<br>
> Is there anything out there that is written simply ? By this I mean I<br>
> don't want to have to install a framework or a jvm or any large<br>
> dependencies. Ideally this would be written in bash or the like.<br>
<br>
</span>You could use the sqlite. Running something like:<br>
<br>
#!/bin/sh<br>
sqlite3 log.db 'INSERT INFO log (message) VALUES ($MESSAGE);'<br>
<br>
in a table setup like this:<br>
<br>
CREATE TABLE log (<br>
        id INTEGER PRIMARY KEY,<br>
        timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,<br>
        message TEXT<br>
);<br>
</blockquote><div><br></div><div>I'm finding I really like using command line tooling to write to syslog...<br><br></div><div>The command "logger" <<a href="http://linux.die.net/man/1/logger">http://linux.die.net/man/1/logger</a>> writes entries to syslog<br><br>I populate shell scripts with wee "glog" functions to wrap this...<br><br>glog () {<br>    local level=$1<br>    local notice=$2<br>    logger -i -p "${level}" -t "name-of-my-script.sh" "${notice}"<br>    echo "${level} ${notice}"<br>}<br><br></div><div>I then inject<br></div><div>   glog user.notice "Ooh, I did something!"<br></div><div>and<br></div><div>   glog user.error "oops, something went wrong - rc=$?"<br>and such.<br></div><div><br>If I *really* wanted to, I could configure syslog to write some messages to a SQL database.<br></div></div><<a href="http://www.rsyslog.com/doc/rsyslog_pgsql.html">http://www.rsyslog.com/doc/rsyslog_pgsql.html</a>><br><br></div><div class="gmail_extra">I did that for a while; found it to be more a pain than a help.  (IPv6 issues blew up the <br>logs on me, and I couldn't query the DB as fast as disk space ballooned away...)<br><br>I'm finding that I [Heart] logger as a way of getting scripty apps to log activity.<br><br></div><div class="gmail_extra">The OTHER thing I'd like is to have something materially better than cron,<br></div><div class="gmail_extra">unfortunately, that's a surprisingly expensive problem.  Improving on cron looks,<br>historically, like it leads to the sort of all-encompassing framework expansion that<br></div><div class="gmail_extra">is where (eek!) we're seeing controversies about SystemD.<br></div><div class="gmail_extra">-- <br>When confronted by a difficult problem, solve it by reducing it to the<br>question, "How would the Lone Ranger handle this?"<br>
</div></div>