Hey guys..

How to write a textfile..from client to server..

I have tried like this

lStrFile = "ErrorLog" +""+day+""+mon+""+year+".txt";
FileWriter fstream = new FileWriter(lStrFile, true);
BufferedWriter out = new BufferedWriter(fstream);

out.write("Error ");

in this code the error will locate in current place.. i mean in our project location... but i want to locate(error file) it on the server...

Recommended Answers

All 2 Replies

file operations are a bit messy since *nix and windows handle filenames differently...
so my advice is... use log4j
its a nice tool for logging in java
if you don't like it you can always find an alternative...

yes, either use Log4J or JDK logging.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.