Sitemap

Amicuk Programming Answers

What is the best way to merge a file content into log file

2015-10-11   Views:0

Advertisement

What is the best way to merge a file content into log file. In worst case, I will read the file line by line as string, then use logger.info(lineString)to output to log file. However, is there better way to do this? The eventual log file will be some

What is the best way to merge a file content into log file.
In worst case, I will read the file line by line as string, then use
logger.info(lineString)to output to log file.
However, is there better way to do this?
The eventual log file will be something like:
log message 1
log message 2
content from file line 1
content from file line 2
content from file line 3
log message 3
log message 4Thanks

The replay answer
Advertisement
John618 wrote:
Thank you and let me explain:
1. What do you mean by better?
I would like to see better performance. read line by line and log each line as string can be slow. Did you measure this and determine that it is actually a problem for your application? Or are you guessing?
Regardless of what you do you are still going to need to read the file.
>
2.The only better way I can think of is not having to do it, but I assume you have a very good reason to want to do this.
Yes, I have to do it beacuse the requirement is to have that file content be part of logging.
Any idea?How is it supposed to be part of it? For example which of the following is better?
        File AAA - contents
                   First Line
                   Second Line XXX
        Log 1
                2009-03-27 DEBUG: Random preceding line
                2009-03-27 DEBUG: First Line
                2009-03-27 DEBUG: Second Line XXX
                2009-03-27 DEBUG: Random following line
        Log 2
                2009-03-27 DEBUG: Random preceding line
                2009-03-27 DEBUG: ----- File: AAA -------------
                First Line
                Second Line XXX
                2009-03-27 DEBUG: Random following lineBoth of the above have some advantages and disadvantages.
The first in a mult-threaded app can end up with intermittent log entries in between lines, so having log lines with thread ids becomes important.
The first can be created by reading one line at a time and posting one at a time.
The second can be created by reading the entire file as a single string and then posting using a single log statement.

Go to See the other 5 answers

Hyper-v VM - merged .avhd files - now cant start as missing .vsv file

Category:DefaultRelease time:2015-10-11Views:130

Hi All, Yesterday i shut down one of our VMs to allow the snapshots to merge and then tried to start the VM but got the following error: 'VM' could not initialize. An attempt to initialize VM save state failed. 'VM' could not initialize. (Virtual Mac[More]

How to merge pdf files into one pdf file?

Category:DefaultRelease time:2015-10-11Views:130

In E-Rec we need the capability to mass printing for correspondance. There i want to merge pdf files for candidates into one pdf file. I am doing the following: Data: lv_document1           TYPE rcf_s_cs_document_content. LOOP AT activity_object_tab[More]

Is there a simple way to merge mp3 files into one mp3 file:

Category:DefaultRelease time:2015-10-11Views:130

Is there a way to simply merge multiple mp3s into one? I have audacity; however, that program becomes cumbersome when merging multiple files. My thanks to anyone for help on this one.I have audacity; however, that program becomes cumbersome when merg[More]

I want to merge mp3 files into one file so i can play a mix in i tunes without pauze

Category:DefaultRelease time:2015-10-11Views:130

i want to merge mp3 files into one file so i can play a mix in i tunes without pauzeAudacity is what you need. Obviously you need to create a new MP3 file of the combined songs and not delete the originals. If your DJ-ing and/or just have too many so[More]

RoboHelp HTML Version 8 - Merging AIR files

Category:DefaultRelease time:2015-10-11Views:130

We use Webhelp Pro to merge 19 separate projects into a single merged help file. Can I do that with AIR output, and if so, how? Can anyone point me to a tutorial?Hi there! I agree with what both Pater and Rick have said, but there may be another way[More]

What is the best way to merge a file content into log file

Category:DefaultRelease time:2015-10-11Views:130

What is the best way to merge a file content into log file. In worst case, I will read the file line by line as string, then use logger.info(lineString)to output to log file. However, is there better way to do this? The eventual log file will be some[More]

Merging PDF Files in Preview 5 in OS X v10.7 Lion

Category:DefaultRelease time:2015-10-11Views:130

I recently updated to the OSX v10.7 Lion operating system.  In the previous version I had, I was able to merge two or more PDF files in Preview just by dragging the thumbnail.  However, in the Lion version, it is not allowing to drag one PDF file int[More]

Adobe Acrobat, Print multiple files to PDF and merge open files to closed files?

Category:DefaultRelease time:2015-10-11Views:130

I have Adobe Acrobat XI Professional. Print to PDF – How can this be done for more than 15 documents at a time?  Right now, if I select 16 or more documents, I cannot 'right click' and choose 'print'.  Is this a setting issue?  If I have many documen[More]

Merge/append the contents of a pdf file to an MS Word document in JAVA

Category:DefaultRelease time:2015-10-11Views:130

Hi experts, I have a requirement to merge/append the contents of a pdf file to an ms word document(Not to be done by including pdf file objects in word). Please suggest some java libraries or ways to do it using java. Any pointers would be appreciate[More]

Problem in Merging PDF files

Category:DefaultRelease time:2015-10-11Views:130

Need to print batches of PDF.<br />The command copy *.PDF > LPT1: (redirected by NET USE) doesn't work.<br />On the printer I get an error message. All files are sent in one file.<br />.<br />I guess this is related to the PDF h[More]

Issue with Merging two files in BPM

Category:DefaultRelease time:2015-10-11Views:130

Hi, I need to merge two files (Balance and transaction) with correlation is defined from ID, Date and Accountnumber.. Sometimes, when there are no transaction records, then balanace file will come up number "0" Balance file: MDk;1728;175;02.09.1[More]

Hot
Excel is throwing error when it click print : 'No printers are installed. To install a printer click the File tab, and then click Print. Click No Printers Installed, and then click Add Printer. Follow the instructions in the Add Printer dialog box' W [More]
I'm pretty new at using Adobe Acrobat 9 Standard and I'm trying to make a form to put on my company's website.  I want to create a hyperlink that will submit the form to my email once a client has fill it out.  I have been testing it and sending the [More]
hi i have an application where i have 2 text fields and one button in order say t1, t2 and b1. on tabbing t1 cursor moves to t2 and on tabbing t2 cursor moves to b1 and on tabbing b1 cursor moves to t1. now when i press tab button on any of the compo [More]
Hello, It seems to be that after transfering a orderline in a Sale order and activating a direct purchase order of that line, it is possible to delete the orderline. Is there a way to avoid this, because otherwise a item is delivered by the supplier [More]
I need to send one IDOC from a NON-SAP sytem to XI. In my scenario I've configured a receiver IDOC adapter with the suitables RFC destination and Port for the SAP R/3 receiver system. We achieve this sending by using the following URL: "http://:/sap/ [More]
I have no audio.  WHen I increase the volume I get a display that says headphones. The iPhone believes the headphones are still plugged in. Check to see if there is any debris in the headphone jack. Don't use air to blow down into the headphone jack, [More]
Hello, When I am running my java application (stand alone), JVM is stopping without any other explanation than -2. In MSDOS console, the only thing that is written is "-2". Somebody has any idea about this problem or what does it mean this error [More]
I have added some URLs to the NavBar on the left hand side of Content Area page and would like them to open as new window. I was wondering if someone could let me know how to do this? Been looking around, but can't find any information. Since adding [More]
Hello, Can you run dumpStack() and paste the error message here? Also please forward all WLST/JMX related questions to the >Management newsgroup at >http://forums.bea.com/bea/forum.jspa?forumID=2058 Thanks, -satya Thanks for your reply. Here is the [More]
Hi, Oracle 11g R2 ApEx 4.2.2 We are in need of giving an MRU form for the customized data by the users. The number of columns will be defined dynamically by the end user. We thought of using apex's standard tabular forms, but they cannot have dynamic [More]