output to log file and error to log error
./ShellFile.sh >& pathToLogFile.log
output to log file and error to log error
./ShellFile.sh >& pathToLogFile.log
logging to a file log4j
// How to log to a file using log4j :
String filePath = "D:/Logs/MyFirstLog.log";
PatternLayout layout = new PatternLayout("%-5p %d %m%n");
RollingFileAppender appender = new RollingFileAppender(layout, filePath);
appender.setName("MyFirstLog");
appender.setMaxFileSize("20MB");
appender.activateOptions();
logger.addAppender(appender);
logger.info("this will be printed in the provided log file");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us