test1.pl and test2.pl have all kind of functions and each one should be able to print to the log file (the SAME log destination,rotation and size, log format and so on...)

What is correct approach to do that? For example I thought about to pass hash argument with log parameters from the main script to every called function, but it sounds to me not so nice a way to do it.

I think the correct solution depends on to what extent test1.pl and test2.pl should keep their possibility to be "independent" on logging.

If it is a "hard requirement" that they should use the same logger, having a logging module which is used by test1 and test2, is certainly the best solution. It can be Log4Perl, as Fishmonger has suggested, or it can be a module you write yourself. I personally use Log4Perl and am quite happy with it, though it is pretty complex and takes some time to be understood.

OTOH, if you want to keep the option available, that one day test1.pl and test2.pl, though being both part of your application, maybe again use different logging mechanisms, I suggest to turn them into modules (if your application logic allows this), and pass the necessary information about the logfiles as arguments.