Categories
Randomness

Random Late Night Meta Post

Recently it seems that every time I post here it’s because I started a new job or there was a new release of Ubuntu.  I decided to not post one at the beginning of June because it would be exactly the same as my previous post with the exception of a slightly different second paragraph [I truly did like the last place].

I’m going to attempt to change that, but I haven’t quite figured out how.  So stay tuned for exciting things on this awesome blog!

 

Categories
Randomness

The Ever Changing Wind

It seems like not so long ago I mentioned how the things were changing. And guess what? They’re changing again.  On Monday I start a new job.

It’s always a bittersweet feeling when you walk away from a job that had the potential to be awesome.  Maybe I just had my hopes set too high.  It’s sad because I really felt that it could have been a great place to innovate and create awesome solutions for complex problems.  That innovation got lost quickly and the rest, as they say, is history.  Anyway, on to the new one, doing the same things I do everywhere.  Hopefully this time I can find a way to make my innovations work and make it stand out beyond all others in my past.

Categories
Randomness

Visualizing Data Is Fun… Confusing… and Possibly Useless.

I created this little image (ok, it’s large) based on the players of Triviosity.  Each line represents a user, while each column represents a game played.  It’s kinda neat to see that the early joiners play a lot.  It’s also kind of neat to see that about every so often a user sticks around.  It’s also interesting to see that users who came in via advertising hardly played (it’s unmarked, but i know where it is). It’s also interesting to see the organic traffic after the advertising is people who actually were looking for it. But all in all, it’s fairly useless. 🙂

Fun times! Here’s the image, it’s huge.

Categories
PHP Randomness Zend Framework

Just a Log

Applications, especially ones that run over and over again with zero persistancy (of the application itself) like a web app needs logging. It’s important to be able to log different types of messages to different places and fortunately Zend_Log is so extensible that it can log to almost anything you can think of.

My typically logging setup consists of multiple log writers configured in Zend_Log to allow me to control where and how certain messages get logged.

Broken down into logging levels I usually have ‘debug’, ‘info’, ‘notice’ all sent to a single file and not enabled in production.
Warnings and Errors are usually considered runtime-issues that are not “omg! it’s broken!” issues, so they get logged to a file and are enabled on production. The last three levels, ‘alert’, ‘crit’, ’emerg’ are all considered to be top priority – aka – your application is failing. And as such these get logged to a file and emailed immediately to a person of importance.

In all cases, in my development environment, all log messages utilize Zend’s Firebug support.

Fortunately Zend_Log supports all this complexity with a very simple set of configuration options.

It’s all done with a few lines of settings in your application.ini file and voila, magic.

Here’s how to bootstrap your logger and set it to a Zend_Registry key for easy use:


protected function _initRegisterLogger() {
    $this->bootstrap('Log');
    $logger = $this->getResource('Log');
    Zend_Registry::set('Zend_Log', $logger);
}

And here’s a sample application.ini – with omitted portions so you can just see the logging items.


[production]
; the operand param doesn't allow for y > 4 & y < 7 so we need multiple writers.
resources.log.production.writerName = "Stream"
resources.log.production.writerParams.stream = APPLICATION_PATH "/logs/production-critical.log"
resources.log.production.filterName = "Priority"
resources.log.production.filterParams.priority = 3
resources.log.production.filterParams.operand  = "<"
resources.log.production1.writerName = "Stream"
resources.log.production1.writerParams.stream = APPLICATION_PATH "/logs/production-errors.log"
resources.log.production1.FilterName = "Priority"
resources.log.production1.filterParams.priority = 4
resources.log.production1.filterParams.operand  = "="
resources.log.production2.writerName = "Stream"
resources.log.production2.writerParams.stream = APPLICATION_PATH "/logs/production-warning.log"
resources.log.production2.filterName = "Priority"
resources.log.production2.filterParams.priority = 5
resources.log.production2.filterParams.operand  = "="

[testing : production]
resources.log.testing.writerName = "Stream"
resources.log.testing.writerParams.stream = APPLICATION_PATH "/logs/testing-notices.log"
resources.log.testing.filterName = "Priority"
resources.log.testing.filterParams.priority = 5
resources.log.testing.filterParams.operand  = "="
resources.log.testing1.writerParams.stream = APPLICATION_PATH "/logs/testing-info.log"
resources.log.testing1.filterName = "Priority"
resources.log.testing1.filterParams.priority = 6
resources.log.testing1.filterParams.operand  = "="

[development : testing]
; this logs all messages
resources.log.testing.writerName = "Stream"
resources.log.testing.writerParams.stream = APPLICATION_PATH "/logs/debug.log"
resources.log.testing1.filterName = "Priority"
resources.log.testing1.filterParams.priority = 7
resources.log.testing1.filterParams.operand  = "="
; no filter on firebug, logs everything.
resources.log.firebug.writerName = "Firebug"
Categories
Randomness Ubuntu

Happy 10-10-10 and More.

Happy 10/10/10 which is kind of cool, but mostly annoying by itself.

Seeing as 101010 is binary for 42, Happy ultimate answer to the ultimate question day.

Also, Happy Canadian Thanksgiving.

Also, Happy Ubuntu Day.  They released Ubuntu 10.10 18 days early so it could fall on 10.10.10.  So if you’re an Ubuntu fan and you’re expecting a release on Oct 28th like it normally would’ve been scheduled, you can go download Ubuntu 10.10 now.