001    package railo.commons.io.log;
002    
003    import java.io.File;
004    import java.io.IOException;
005    
006    import railo.commons.io.res.util.ResourceUtil;
007    
008    /**
009     * Simple Logger to log data to a file
010     */
011    public final class LogFile extends LogResource {
012        
013        /**
014         * Constructor of the Logger 
015         * @param file file to log to
016         * @param logLevel 
017         * @throws IOException 
018         */
019        public LogFile(File file, int logLevel, String charset) throws IOException {
020            super(ResourceUtil.toResource(file),MAX_FILE_SIZE,MAX_FILES,logLevel,charset);
021        }
022        
023        /**
024         * Constructor of the Logger 
025         * @param file file to log to
026         * @param maxFileSize max file size if file is greater creates a backup file of the actuell file and creates a new one.
027         * @param logLevel 
028         * @throws IOException 
029         */
030        public LogFile(File file, long maxFileSize, int logLevel, String charset) throws IOException {
031            super(ResourceUtil.toResource(file),maxFileSize,MAX_FILES,logLevel,charset);
032        }
033        
034        /**
035         * Constructor of the Logger 
036         * @param file file to log to
037         * @param maxFileSize max file size if file is greater creates a backup file of the actuell file and creates a new one.
038         * @param maxFiles max count of files
039         * @param logLevel 
040         * @throws IOException 
041         */
042        public LogFile(File file, long maxFileSize, int maxFiles, int logLevel, String charset) throws IOException {
043            super(ResourceUtil.toResource(file),maxFileSize,maxFiles,logLevel,charset);
044        }
045    }