> Now the question is when i deploy the application to websphere - how
> do i make it write to the log file that is stored in teh war file.
>
> Meaning - the war file will have all the source code / all the log
> files. The app needs to somehow find the log file while its stored in
> the war file itself.
You can not write to a log file inside the war file.
Arne
> when i run the application from my machine (tomcat) and i use the line
> logfile = d:/webroot/hugelogfile.log
[quoted text clipped - 3 lines]
> Now the question is when i deploy the application to websphere - how
> do i make it write to the log file that is stored in teh war file.
You can't. You have to have the log file on the host file system somewhere.
Or are you asking how to make WebSphere use the log file as specified inside
the WAR? one easy way is to change the properties file in the deployment
environment after it comes out of the WAR. Another is to build the WAR with
either a relative filename or an absolute filename relevant for the specific
host.
Yet another alternative is to load the properties through a classloader
(ClassLoader.getResource()) or via related methods that root their search in
the classpath. The classpath for a Web app is rooted at
<context>/WEB-INF/classes/.
Some things with relative pathnames in a Web app come from the context root
directory, some from the classes/ subdirectory, and some from a path relative
to the Web container (WebSphere) installation directory.
> Meaning - the war file will have all the source code / all the log
> files. The app needs to somehow find the log file while its stored in
> the war file itself.
Are you saying that you want the actual log file to reside inside the WAR,
rather than somewhere else on the app host machine file system? That is not
possible.
> This is where my issue lies - i dont get why it would work in tomcat
> (when i specifically tell where the location is) and not work when i
> dont tell where the location is by using /hugelogfile.log
But saying "/hugelogfile.log" does specify a location.
- Lew
RigasMinho - 01 Mar 2007 15:15 GMT
> > when i run the application from my machine (tomcat) and i use the line
> > logfile = d:/webroot/hugelogfile.log
[quoted text clipped - 36 lines]
>
> - Lew
Thanks guys -
I think what I was asking was impossible to do - although i wonder how
the developer did this before. I dont think it was in a war file but
a zip file (is that how weblogic is run?) anyways..
I just did the solution of storing the log file in another folder off
another system. And now it works.
I never knew you couldnt write to a log file inside the war file
itself.
THANKS for your help guys.
PS i hate programming - which is why i'm going to change my career to
become an head hunter for IT. Let me know if you want to use me to
represent you. e-mail me at minho.cho@gmail.com My background is all
in IT so i know what IT people want in a job. 4 year degree in CS / 1
year experience in Exchange + Servers / 1 year experience in
Programming. So why would you want to use me ? Cause i'm garunteeing
you last recruiter / headhunter you spoke with was some retarded kid
who just started to do IT recruiting who has no idea what IT is really
about except "i want to make huge commissions placing people"