Getting gateway loggers via script?

This may be what you were looking for:

…or at least a place to start.