Results 1 to 6 of 6
Thread: log file
- 04-12-2011, 02:35 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 20
- Rep Power
- 0
log file
hi! I'm using java.util.logging to make a file with my log. This code works in Windows, but it doesn't in ubuntu (I need the ubuntu version):
It doesn't open the file log and continues writting on it, it start a new file called log.1, log.2, log.3... every time I execute this code.Java Code:public static void logInit(){ try { FileHandler fh = new FileHandler("/home/tomcat6/log",true); fh.setFormatter(new SimpleFormatter()); log = Logger.getLogger("/home/tomcat6/log"); log.addHandler(fh); log.info("example"); } catch (IOException e) { } }
I have no idea how to solve it, could you help me?
thanks in advance!!
- 04-12-2011, 02:48 PM #2
I guess your program has not access to this folder.
You can try give access
Java Code:chmod 777 log
Skype: petrarsentev
http://TrackStudio.com
- 04-12-2011, 02:56 PM #3
Member
- Join Date
- Apr 2011
- Posts
- 20
- Rep Power
- 0
thank you so much, but, I've already tried this.
When the program creates a new file it is like this:
It is in /home/tomcat6, i tried 777 to home, tomcat6 and log, but it didn't work!Java Code:ubuntu@ubuntu:/home/tomcat6$ ls -l total 96 -rw-r--r-- 1 tomcat6 tomcat6 64 2011-04-12 15:40 log -rw-r--r-- 1 tomcat6 tomcat6 64 2011-04-12 16:03 log.0
I can'd understand!
Tnaks!
- 04-16-2011, 08:33 AM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
- 04-16-2011, 10:42 AM #5
Member
- Join Date
- Apr 2011
- Posts
- 20
- Rep Power
- 0
- 04-19-2011, 12:09 PM #6
Similar Threads
-
pack200 .gz file unpack and create .jar file in browser(speed test).
By maheshsardar in forum Java AppletsReplies: 1Last Post: 08-04-2010, 03:24 PM -
Log4J : logs of a specific category to a file, but only errors to the file AND stdout
By msegmx in forum Advanced JavaReplies: 0Last Post: 07-15-2010, 01:23 PM -
Sending a File from Server to Client and saving the file to Clients computer
By al_Marshy_1981 in forum NetworkingReplies: 8Last Post: 02-18-2010, 12:54 PM -
how to read openproj(Projity) file i.e. ,POD file(Project Management file)
By mahendra.athneria in forum New To JavaReplies: 0Last Post: 02-11-2009, 09:53 AM -
How to parse the CSV(Comma separation values)file and validate the file using java
By padmajap13 in forum Advanced JavaReplies: 7Last Post: 05-23-2008, 03:46 AM


LinkBack URL
About LinkBacks


Bookmarks