in reply to Adding a Log to a perl2exe file
First, I wouldn't recommend naming a function "log()", since log is a built-in. Use a different name and run the script from the command line to make sure nothing else is causing a problem.
Secondly, you probably need to tell perl2exe that you're using Log::Dispatch::File, as it's probably not smart enough to tell that by looking at the code, since you're not "use"ing it but letting Log4perl require it at runtime.
Thirdly, I would recommend using Log4perl's native file appender (comes with Log4perl), Log::Log4perl::Appender::File.
Fourthly, there's nothing wrong with your configuration, but you probably want to use a Log4perl configuration file (or string!) to keep things nice and clean and in one place.
|
|---|