Trobule in saving log in file which is in my context path

Hello all, i am facing problem while saving log into Log file from servlet. I am using Log4j library and eclipse as IDE. When i push any log information to log file, it make log file default to eclipse path not in my servlet context path. I am using log4j.properties file for configuration. Which has following contents :
log4j.rootLogger=DEBUG, FA
log4j.appender.FA=org.apache.log4j.FileAppender
log4j.appender.FA.File=log.txt
log4j.appender.FA.layout=org.apache.log4j.PatternLayout
log4j.appender.FA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
and servlet code for configuring properties file is : PropertyConfigurator.configure(context.getResource("/log4j.properties"));
what when i push content to log.txt it create file in my eclipse path. How can i set the file path as my context path for log.txt?
thanks in advance.
sanjeev

I don't know such way. But maybe You can read the file when application starts (in ServletContextListener) and change this property when it's already running. Don't know if this helps, but may try.

Similar Messages

  • How to include a static file which is outside Applicaton Context in JSF?

    I need to inlcude lot of static contents which are residing in outside Application Context root in JSF.? is there any better way to do include static files which are outside the Context root?

    The total no of static content files will be around 20000 to 30000 and i will only know the file name at run time from the user input.

  • To Read the contents of the properties file which is located in webserver

    Hi,
    I have one requirement where I have to read the contents of a property file which is located in some path in server. Say for example, when you click on link abcd then contents of abcd.properties file should be displayed in one text view in webdynpro . I am trying to implement this in webdynpro for java. The main thing is like I am not able to retrieve the server path of the file and hence not getting the file contents. I tried using methods like  getApplicationPath() or getRealPath() but its not working. So can you guys please help me on to how to read the server file contents.
    Thanks and regards,
    Sai

    Hi Romano,
    Thanks a lot for your reply. However, I forgot to mention one thing in my question. Its like the path will be different everytime. Say, we have systems like development, acceptance, production. So when the user clicks on the link abcd, it should take the path of development system and similarly when the user clicks on the link in acceptance or production, the path will be different. say for example, in development the path will be
    usr/cluster/dev/abcd.properties but it acceptance it will be usr/cluster/acc/abcd.properties. So just want to know whether this will work? Anyway, I will give this a try.
    Thanks once again,
    Sai

  • To which folder does OSX background saved TextEdit recovery files?

    Hi, while traveling without an internet connection I workd on a TextEdit file which was probably saved in the background automatically as a temp recovery file...somehow I lost the file, whether through a failed iCloud synch upon returning home or whatever...I think though that I may have backedup my system with Time Machine before losing the file altogether. Could a background recovery version of it be in a folder accessible through Time Machine?
    (By a background saved recovery file I mean the temp TextEdit file which in the event of a crash or system restart would allow the file to be recovered.)
    Thanks

    sorry...was exhausted, will rewrite more clearly

  • The log file which can be used to track the HTML preview of HFR Reports

    Hi,
    Could you please let me know the log file which can be used to track the HTML preview of HFR Reports?
    Thanks,
    Aparna

    You could check the FinancialReporting0.log and FRLogging.log .You could refer the same in the
    " http://docs.oracle.com/cd/E17236_01/epm.1112/epm_install_troubleshooting_11121.pdf" page 47.

  • A file which was created and saved using Adobe Photoshop CS6 is not opening anymore HELP

    Hi, please help with my issue which is as follows:
    A file which was created and saved using Adobe Photoshop CS6 is not opening anymore and sends a message saying that the file is not compatible.
    What should I do, I have invested so much in that file and I dont think i will be able to do it all over again.

    That's why people do incremental saves and use backups... You could try to open the file in an image viewer like IrfanView and see which parts are salvagable, but that's as good as it gets most likely...
    Mylenium

  • How to upload a flat file which is saved as .html format.

    hi techies,
    I have to upload a flat file which is saved in .HTML format. Is there any function moudles seperately to
    upload html flat file or using GUI_UPLOAD.. can we upload it ???
    Please need a suggestion...
    Rgds.,
    subash

    hi gautam,
    this FM is taking html string as input and giving the output, not the file...
    any more suggesstions dude..
    Rgds.,
    subash

  • Where windows batch file which log off windows lies ?

    where windows batch file which log off windows lies ?
    to which me can call from java code to log off my pc?

    You should use a brute-force algorithm on the on/off switch on your pc. I suggest a rate of 30 hits per minute.

  • Separated trace file which I can read with the log viewer

    Hi All,
    I 'd like to write trace infomation.
    I know I can use the default trace.
    But I 'm looking for a way to write my application information in a separated file,
    which I can read with the log viewer.
    Can someone help me with this
    Thnaks
    Steve

    Hi epexpert,
    thaks for your reply.
    I tried it with the Filelog.
    The Problem is that it logs to the file (its not problematically) but also to the defaulttrace
    and thats not my preferred solution.
    Do you have any other ideas?
    Bye Steve

  • What will happen when redo log file or archive log file, which is yet to be

    What will happen when redo log file or archive log file, which is yet to be read by logminer is corrupted? It seems that the captures process hangs between “Paused for flow control” and “Enqueuing Messages”. How to come out of this condition without recreating the captures process?
    Any clue is helpful
    Thanks in advance for your help.

    Basically you can't skip SCN since it will result in a data integrity issues (say you had skipped some inserts and later there will be some updates to a not replicated data).
    Streams maintain their own checkpoint tables with transaction related stuff. So there is no way you can jump over a range of SCN's without recreating capture.
    The only thing you can try - temporary give capture process a rule without any objects. But it will need to mine through the redo anyway.

  • [svn] 1978: Bug: vendors. properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly .

    Revision: 1978
    Author: [email protected]
    Date: 2008-06-06 08:05:34 -0700 (Fri, 06 Jun 2008)
    Log Message:
    Bug: vendors.properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly.
    QA: Yes - we need automated tests to make sure that errors.properties and vendors.properties in BlazeDS/LCDS are loaded properly.
    Doc: No
    Modified Paths:
    blazeds/branches/3.0.x/modules/common/src/java/flex/messaging/util/PropertyStringResource Loader.java
    blazeds/branches/3.0.x/modules/opt/src/jrun/flex/messaging/security/JRunLoginCommand.java
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

    I have a lot of grief with this version of Windows Media Player.
    It is very buggy and frustrating to use.
    I have my Music library on a QNAP NAS, which is as reliable as they come.
    System notifications make it not save changes.  It also does not do a good job of interpreting albums and artists from folders.  Changes to track names are not saved, nor are tracks moved to other albums, renamed albums, changes to genre, artist
    or date.  It separates and merges albums/tracks without sense or reason.  Some changes I've made up to 4 times, then closed WMP and re-started my machine to check if it has/hasn't saved the changes.  Often it has not.
    This is the first time I've used WMP in this capacity, and I do not recommend it.
    New service pack please.

  • Retain Console System.log Events file for Usage Analysis

    I recently became interested in tracking the usage of some Apple computers. I discovered that the system.log events file in Console provides the login and logout times. So, I was able to use that to calculate how much time the computers are being used. This was very handy because there was data from October 2010 to June 2011. I went back a few days later and discovered the log files had been purged all except a few weeks of data. Is there any way to prevent them from being purged? Or, can I increase the size of the retained system.log file? What's the point of a log file tracking events if it's only going to be deleted? Alternatively there are programs designed to keep track of computer usage such as login and logout times as well as user usage by application. Would you recommend one of these?

    Thanks for bringing the typo to my attention. I've corrected that now. I'm reminded of the phenomenon by which we see and read words as groups of letters regardless of their positioning.
    I've not really had any specific system problems that cause huge log files. However, sometimes when diagnosing problems it's nice to have a long period of time to examine possible issues.
    Regarding your #3, opening .bz2 files... Have you saved these log files from Console and then tried opening them? It's just bazaar. The file opens to another file, then opens to another file, and so on. You never see the actual file contents. Others have observed the same thing.
    Regarding your #4, I created the script you mention. It's described here:
    http://www.resourcesforlife.com/docs/item4103
    However, I'd like to just go ahead and use the existing system.log events.
    Greg

  • Error saving Project 2010 files to network drive - doesn't see network drive

    ANSWERED (11 April 2014):
    So it seems the resolution to this is to simply create a new share with a different name. I used the existing folder (to retain NTFS permissions) and just select to Add a new Share (applying the same Share permissions as the non working Shares).
    Deploying this new Share via Group Policy as a test resulted in staff being able to open files from Windows Search, save files through MS Project and the Share being accessible through browsing SMB.
    All problems resolved by using a new share name for the existing folder. Seems to be a corruption in the namespace.
    Note: I had previously deleted the share and recreated it. I had removed all NTFS permissions and readded (through both the GUI and icacls). This didn't make a difference.
    Only changing the name of the share fixed the problem.
    Original Question
    Already
    posted here... but Microsoft Support has not responded.
    It seems some staff on some computers are having problems saving MS Project files to the network. This is only since an upgrade to SBS2011 (from SBS2003). The only difference now, is that network drives are mapped via group policy rather than a  'net
    use' script.
    This is affecting users on Windows 7 and Windows Server 2008 R2, with either MS Project 2007 or 2010. The users have full change access to the folders and can create new files and modifying existing files, just not a MS Project file. Other file tyes, e.g
    Word .docx, Excel .xlsx, Adobe .pdf files, all work fine. These files can be opened, edited and saved normally without problem.
    To replicate this:
    The user opens an existing file or creates a new file on the network folder (either through Windows Explorer or MS Project). They then click File > Save in MS Project and receive the following error (see pic below):
    An interesting symptom of this is that if you select File > Save As in MS Project, the Sae As dialog box doesn't remeber the path location of the network drive. MS Project instead prompts to save the file in the local users documents folder (see pic below):
    If they browse back to the original folder where the file was saved and choose to save it there, they are of course, prompted to overwrite the existing file and they can save the file. But the same thing happens every time they open the file.
    It seems the problem is that Project isn't seeing the path of the file or that the network drive is attached.
    If a user closes the file without saving it, they are prompted to save the file and the prompt shows the drive path:
       Do you want to save changes to "N:\... Projects\Active Projects\CC...\F4 Project Plan File\004 Programme\test project file.mpp"?   
    But choosing to save the file gives them the same result as Save As, they are prompted for a new location as if the original file location doesn't exist.
    I have disconnected the mapped drive and connected it again using net use but get the same error.
    I have reinstalled MS Project 201, installed Project 2010 SP2 and installed Windows updates and it does the same thing, exactly the same symptoms.
    Further, if the user opens a file from the network drive, the file shows in the Project recent files list. If they try to open the file from the recent files list in project they get the following error:
    "Project cannot open the file.
    -Check that the file name and path are correct.
    -Check that the file format is recognized by Project.
    Project files saved in a version earlier than Microsoft Project 98 can't be opened...."
    This is a test file that I created on the user's computer and network drive, This is being opened with the same version it was created in. If I browse to the folder in Windows Explorer I can open the file. Of course, I then can't save the file (I still get
    the original error). I'm logged on with Domain Admin privileges.
    I've checked these links from other threads (neither apply to my scenario):
    http://support.microsoft.com/kb/983458/en-us|
    http://social.technet.microsoft.com/Forums/en-US/excel/thread/2eeea140-7e6c-4cb9-a89b-06d2102bd9f7/
    I've downloaded my TechNet version of he software and installed it with Sp2 and Windows updates and it does the same thing. This also happens on the Remote Desktop server (Server 2008 R2) using MS Project 2007.

    Case 1
    This error message appears when the document is open on two or more computers that are running different operating platforms. For example,
    if the document is open on a Macintosh computer and you open it on a second computer running Windows or Windows NT, the error occurs when either user tries to save the document.
    This problem stems from a difference between the ways Macintosh OLE and Windows OLE open files. As a result, you cannot save a file on two different operating platforms at the same time.
    Case 2
    This error occurs in Word 97 for Windows if you save to a MAPROOT type network drive connection on a NetWare server where spaces exist in
    the file or folder name.
    Case 3
    This problem may occur if an anti-virus program running on a network has the ability to scan for macro viruses in documents in shared network
    folders.
    For example, if you have the following:
    a shared folder on a network server
    -and-
    an anti-virus program is running on the network server that is set to monitor the shared folder,
    when you attempt to save a document (across the network) to the shared folder, the anti-virus checker may cause the error to occur.
    Case 4
    This problem may occur on Novell networks when the AutoRecover files path is either blank or set to a network drive.
    According each, please try the following workaround:
    WORKAROUND
    To work around this problem, use one of the following methods appropriate to your situation.
    Case 1
    Method 1:
    Move the document to your local hard disk for editing. Move it back to the server after you finish.
    Method 2:
    Save a copy of the
    file with a different
    file name, and work on the copy, either on your hard disk or on the server.
    Case 3
    Method 1:
    Move the document to your local hard disk for editing. Move it back to the server after you finish.
    Method 2:
    Do not use spaces in the directory or document names.
    Method 3:
    Do not use MAPROOT-drive connections. Map your drive connections to the volume-level only.
    Case 4
    Turn off the anti-virus protection on the network server and then try to
    save the document. Contact your anti-virus protection software company for additional details and/or updates to their programs.
    Case 5
    Set the AutoRecover files path to your local drive. To change the AutoRecover path, use the following steps:
    1.
    On the Tools menu, click Options.
    2.
    On the File Locations tab, select AutoRecover files and then click Modify.
    3.
    Change the Modify Location dialog box to a
    folder on your local drive and then click OK.
    4.
    Click OK to close the Options dialog box.
    Hope that helps.
    Smith

  • Print to PDF - using Snow Leopard (Saving a PDF file when printing is not supported. Instead, choose

    i have a PDF form that i created that is used as a custom proposal that my company sends out to potential clients. the form in its editable state is only used internally. we recently upgraded to snow leopard, but prior to the upgrade, we were able to fill the custom proposal form out using adobe reader, and, as you well know, we weren't able to save that edited document as a PDF with the custom form fields filled out. our work around using adobe reader was to print to a pdf using the adobe pdf printer in the printer dialog. with the addition of snow leopard, however, instead of choosing the adobe pdf printer, we were to choose PDF from the bottom left corner, then Save As PDF, and it would spit out an uneditable pdf that then allowed us to email it to the potential client without them being able to edit it as well as have an internal, digital copy for our records instead of having lots of paper floating around (i know this is also doable using security that disallows the client certain editing privileges, but printing to a pdf is much quicker and more efficient, and the pdf security isn't really that secure at its best).
    in any case, i came across this gem of a post here on the support forums that installs another option from the PDF drop down on the bottom left of the print dialog menu that reads Save As Adobe PDF and is supposed to do exactly what i am trying to get it to do...print to a pdf file from adobe reader.
    http://kb2.adobe.com/cps/509/cpsid_50981.html    
    once i updated to acrobat 9.2 (as the link above suggests 9.1), however, the Save As Adobe PDF does appear in the print dialog menu, but it still gives me the same error that acrobat 8 - 9 gave me while using Snow Leopard — Saving a PDF file when printing is not supported. Instead, choose File > Save — and as i've already explained, you can't save an edited pdf form in reader (as i am the only one in the office with acrobat) and still keep the fields as you've entered them in. the only work around is to print to a pdf but is apparently having some recent problems.
    using acrobat, however, i know that i can save the editable pdf as a new file with the fields customized as i have left them, but it still saves it as an editable pdf and the print to a pdf option still remains the best option...that way we have digital copies internally that are uneditable that can be printed at any time or emailed to the client.
    how can i do print to a pdf, based on what i've written above, using snow leopard and acrobat and reader?

    A simple way is to flatten the form fields, which converts the field appearances to regular page contents. You can do this with JavaScript or PDF Optimizer (Advanced > PDF Optimizer > Discard Objects > Flatten form fields). A very nice script that adds a custom menu item can be found here: http://www.uvsar.com/projects/acrobat/flattener/

  • I saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    i saved a word file onto my imac.  when i go to open file in documents with pages the file is grey and unable to open.  the workable files are highlighted in bold.  is there a way to open this file????

    THis is safe for Mac's? Sorry, I have just never heard of this site before.
    And there are literally tens of thousands of sites of which I've not heard, too. Not this one.
    It's legit. There are lots of links in Apple Support Communities to the LibreOffice web site, as well as others that are legitimate open-source developers of options to buying MS Office, such as NeoOffice and OpenOffice. I have Open Office installed on one of my older Macs that can't run Office 2011 and it is rock-solid.
    I've been here too long to start posting bogus urls now.

Maybe you are looking for