• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Using Simple Logging

Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I recently decided to use simple log for my logging as it is pretty much simple but recently, I met up with some problems using it.

I am using netbeans to develop for a project that requires logging function and I chose simple log since it seems easier that log4j ...etc. In netbeans, it always generates a 'dist' folder for the jar files generated after being built. I placed the properties files and rollover properties right next to the jar file in the dist folder that netbeans generated and enabled the log to write to file but when I ran a simple test for logging functions, it didn't even write or log anything. I moved the properties to the 'src' folder and compiled and built it (now the properties files are part of the jar file) and it started to log and output to a file. Why is that so ? Is there a way I could avoid putting the properties into the source folder then compile and build it ? It would restrict users including myself to adjust the properties when needed. I noticed that the 'simplelog-config.properties' have a 'simplelog.logFile' field where I can specify where I want it to log to. When I specify 'log/application.log', it didn't log the output anywhere until I changed it to the very precise folder '/home/<user>/netbeansproject/<app-name>/log/application.log'. then did it start logging. I doubt if I want the user to create some netbeansproject folder with whatever folder names and files needed. Is it possible to have an abstract name like 'log/app-log.log' like how the java.util.File works where you can use 'log/app-log.log' rather than the full filepath ?

So how do I solve the above problems ?
Hold that thought. Tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic