/**
 * 
 */
package it.mice.voila.runtime.log4j;

import java.net.InetAddress;
import java.net.UnknownHostException;
import org.apache.log4j.PatternLayout;

/**
 *
 */
public class HostNamePatternLayout extends PatternLayout {

    /** {@inheritDoc}
     * @see org.apache.log4j.Layout#getHeader()
     */
    @Override
    public String getHeader() {
        try {
            return "Ambiente: " + InetAddress.getLocalHost().getHostName() + "|Altre info: ";
        } catch (UnknownHostException e) {
            return super.getHeader();
        }
    }
}
