How to setup file path in log4j.properties file in mac | Selenium Forum
M
Posted on 11/01/2016
I was trying to run a simple program suggested in module 20 class 2 to see if log4j is generating a file in mac. when ran the program, no file is generated.

How to setup log4j.properties file in mac for generating a file in a specific location////////.

M
Replied on 12/01/2016

got the solution but its defaulting in Eclipse's project directory but not the path that I have suggested to generate the file. Any clue? Responsive image


M
Replied on 12/01/2016

what are the log4j.properties.


M
Replied on 16/01/2016

it was the .properties file that was created in module 20. I have provided the path for creating .log file at a specific location but its getting created at the default project location


M
Replied on 17/01/2016

i mean what have you written inside log4j.properties?


M
Replied on 28/01/2016

hi

beloq is the content that I provided in the file --

#Application Logs
log4j.logger.devpinoyLogger=DEBUG, dest1
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.maxFileSize=5000KB
log4j.appender.dest1.maxBackupIndex=3
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %c %m%n
log4j.appender.dest1.File=\\Users\\Documents\\workspace\\core_hybrid\\src\\com\\Application.log
#do not append the old file. Create a new log file everytime
log4j.appender.dest1.Append=false



NOTE: This setup is done on Mac


M
Replied on 28/01/2016

so you have tried forward slash and backward slash (////////\\\\\\\\\)


M
Replied on 03/02/2016

nope only backward slash Responsive image Do I have to try forward slash?


M
Replied on 03/02/2016

try it.