I am working on a amll project in Java that includes many classes.
Each of the classes has a Logger object. I have associated a
FileHandler with
each of these Logger objects. The file is the same for each of these
classes "log.xml" Now I want all the classes to log to the same file.
However, this
does not happen. Each class creates its own log file. The base class
uses the file "log.xml". Each subsequent class creates a log file
"log.xml.1" , "log.xml.2" and so on. Can I get all my classes to log to
the same file? If so how?
The second query is about threads. My project uses the internet to get
data. Now I want only a specific number of threads to access the net
at any given time (the exact number will be specified in the
preferences). The other threads not accessing the net should function
normally. How can I achieve this sort of behaviour? Please keep in
mind that this is the first time I am working with threads.
Thanx,
Huzefa
Each of the classes has a Logger object. I have associated a
FileHandler with
each of these Logger objects. The file is the same for each of these
classes "log.xml" Now I want all the classes to log to the same file.
However, this
does not happen. Each class creates its own log file. The base class
uses the file "log.xml". Each subsequent class creates a log file
"log.xml.1" , "log.xml.2" and so on. Can I get all my classes to log to
the same file? If so how?
The second query is about threads. My project uses the internet to get
data. Now I want only a specific number of threads to access the net
at any given time (the exact number will be specified in the
preferences). The other threads not accessing the net should function
normally. How can I achieve this sort of behaviour? Please keep in
mind that this is the first time I am working with threads.
Thanx,
Huzefa
Comment