Putting it at the top of the script library file should definitely work, it runs once on scripting restart (basically whenever you save a script anywhere) and would define it then.
It's how I do all my logging in library scripts:
logger = system.util.getLogger('FCRM.Project.Library')
#rest of file
Good catch, Kevin, I actually didn't notice that usage in the earlier post.
Also, you don't need to use foo.logger as the namespace is already implied to be the same library script you're referring to it from.
It can be called from within the library where it is defined using logger.info() and outside of that library using Library.logger.info(). Technically, it can also be called within the library using Library.logger.info(), it's just redundant.