Level variables like $DEBUG or $WARN have numeric values that are internal to Log4perl. Transform them to strings that can be used in a Log4perl configuration file, use the c<to_level()> function provided by Log::Log4perl::Level: