$window([color:green]nickname).logfile[/color]
If you want to get the logfile for the active window (either channel or query) you can use this:
$window($active).logfile

That needs the window to be open, though...