Best way to log runtime parameters

i have a log procedure that takes a varchar2 parameter with autonomous transaction. in my proc , just after begin statement, i want to log all parameter values given at runtime. but i dont want to use pipes to concat the param values for each procedure i want to log, is there an easier way to achieve this ?
procedure log_my_proc (in_params in varchar2) is
pragma autonomous transaction
begin
insert into proc_log_table values (in_params);
end;
procedure something (param1 in varchar2 ,param2 in number, param3 in varchar2,...) is
begin
log_my_proc('something is called ' || ' param1: ' || param1 || ' param2: ' || param2 ....);
some other work....
end ;

It took me a few seconds to generate this:
log_my_proc('something is called '||chr(13)||chr(10)
         || ' param1 : ' || param1  ||chr(13)||chr(10)
         || ' param2 : ' || param2  ||chr(13)||chr(10)
         || ' param3 : ' || param3  ||chr(13)||chr(10)
         || ' param4 : ' || param4  ||chr(13)||chr(10)
         || ' param5 : ' || param5  ||chr(13)||chr(10)
         || ' param6 : ' || param6  ||chr(13)||chr(10)
         || ' param7 : ' || param7  ||chr(13)||chr(10)
         || ' param8 : ' || param8  ||chr(13)||chr(10)
         || ' param9 : ' || param9  ||chr(13)||chr(10)
         || ' param10: ' || param10 ||chr(13)||chr(10)
         || ' param11: ' || param11 ||chr(13)||chr(10)
         || ' param12: ' || param12 ||chr(13)||chr(10)
         || ' param13: ' || param13 ||chr(13)||chr(10)
         || ' param14: ' || param14 ||chr(13)||chr(10)
         || ' param15: ' || param15 ||chr(13)||chr(10)
         || ' param16: ' || param16 ||chr(13)||chr(10)
         || ' param17: ' || param17 ||chr(13)||chr(10)
         || ' param18: ' || param18 ||chr(13)||chr(10)
         || ' param19: ' || param19 ||chr(13)||chr(10)
         || ' param20: ' || param20 ||chr(13)||chr(10)
         || ' param21: ' || param21 ||chr(13)||chr(10)
         || ' param22: ' || param22 ||chr(13)||chr(10)
         || ' param23: ' || param23 ||chr(13)||chr(10)
         || ' param24: ' || param24 ||chr(13)||chr(10)
         || ' param25: ' || param25 ||chr(13)||chr(10)
Given that you will already have a (nicely formatted) list of the parameters in you procedure spec, shouldn't this be a simple copy and paste?

Similar Messages

  • Best way to log data

    I have an application that receives data from a source, and I would
    like to create and maintain a log file with this data. Small bits of
    data will be received at least every minute, and often once every
    second. The user can also view the logged data at any time.
    Lastly, each entry is timestamped, and I would like to be able to
    remove log entries that are x hour/days old.
    What I would like advice on is what is the bext way to accomplish this?
    Clearly a bad way to do this is every time I get data, read the log in,
    remove old entries, rewrite all the remaining entries, and finally
    append the new entry. This uses way too many file operations.
    I have briefly looked at the java.util.logging stuff, but it appears that
    the purpose of that is more for code debugging/etc. It also doesn't
    appear that there are methods to read the logs. So, this does not
    look like an "easy way out".
    I know how to append to a file, but I am not sure if I should leave
    the file open during execution of the program and simply flush
    the stream/buffer, or open and close the file everytime I write.
    The latter is clearly more expensive, but safer.
    I don't know how to delete data from the beginning of a file.
    To summarize, what is the best way to read and write data to
    a file such that:
    1) the data is appended to the end of the file (easy)
    2) the data is removed from the beginning of the file
    3) the data that is written is not lost of the program crashes/etc.
    4) the whole logging business is not too expensive
    Any suggestions?
    Thanks,
    Chuck.

    Here's what we did at my last job:
    Incoming messages are logged to disk via FileOutputStream (maybe with BufferedOutputStream encasing that, I don't remember) this outputstream is not closed until the applet is stopped. System.out is also reassigned to this fileoutputstream to capture all messages.
    At the same time, there is an InputStream reading from that file. As data is read, we stick the text into a TextArea.
    When the TextArea size hits some certain amount (maybe 20,000 characters) we'd remove ... maybe 5000 from the top. Log stays the same tho
    When the day rolls over, we switch log files
    You're questions:
    1) the data is appended to the end of the file (easy)
    Yes. But if you're not using streams, you should check that out.
    2) the data is removed from the beginning of the file
    That's pretty easy. Open the file for reading, open a new file for writing. Read the first n bytes but don't write them. Then write the rest
    3) the data that is written is not lost of the program crashes/etc.
    Data should be fine if it's logged to disk
    4) the whole logging business is not too expensive
    Saving to disk isn't very expensive at all. In fact, normally writing to disk is slow enough that stuff just gets put into a buffer somewhere to get sent to the disk and the processor goes on with the program.

  • Adobe Forms: Best way for logging?

    Hi,
    we're using Adobe Forms having very complex forms partially.
    Because of it's complexity, the implementation is not free from defects. That's why I thought about proper logging of what users do within the form.
    What's the best way to achieve this?
    I thought of console messages - but this would require the user to send us the document in case of an error.
    I also thought of writing a logging file in a central directory that all users have access to. But I don't know if this is even possible?
    Does anyone have experience with proper logging of user actions in forms?
    Thanks and BR Matthias

    Test Screen Name wrote:
    Something not secret could be a report button which generates information ready for the user to copy/paste into an email. Not sure of the best way to offer a large body of copyable text, any ideas?
    A dialog box with a large, multi-line text field, where you can place the text and the user can copy it to an email and send to you. You can even generate the blank email message using a launchURL and a mailto command.

  • What is the best practice for logging runtime error  or uncheked exceptions

    hello
    my main problem is logging the nullPointerException to a file
    suppose I have this method
    public void myMethod()
       //..... some declaration here
       User user = obj.findUser("userx"); //this may return null
       System.out.println("user name is "+user.getName()); // I may have a null pointer exception here
    }so what is the best practice to catch the exception ??
    can I log the exception without catching it ???
    thank you

    A terrible way of logging exceptions.Not that im not agreeing with you, but why? (I havent
    actually used this)Because it's always on, for one thing. It's not really configurable either, unless you go to some trouble to make it so. You'd have to provide an InputStream. How? Either at compile-time, which is undesirable, or by providing configuration, which a logging framework has already done, better. Then there's the fact that you can't log anything other than the stacktrace - not particularly helpful a lot of the time. In short, it's a buggy and incomplete solution to something that's already been solved much much better by, for example, Log4J

  • Best way to log footage shot on P2 Cards?

    What is the best way to send footage shot on P2 cards to an offsite location for logging and transcribing? Any suggestions on converting the MXF files to MOV or other formats without having to buy a $600 program would be appreciated.

    Import into FCP. String out on a timeline. Add the TIMECODE READER to all the clips so the loggers can SEE the timecode. Output to DVD via a capture card to a DVD Recorder.
    Or...
    Import into FCP. String out on a timeline. Export a reference movie. Take into Compressor, add the TIMECODE READER in the FILTERS area, encode for DVD.
    Or...
    Purchase Proxymill from www.imagineproducts.com. Have it make low res quicktime movies with burned in code of all the footage. Burn those files to a data DVD. Mind you, this means that every start/stop of the camera will be a separate file...just as they appear in FCP. But this is quick, runs in the background, and doesn't tie up an edit station.
    Shane

  • Best way to log price information ?

    hi,
    does anybody has experience in logging price information. Each time the price of an item is updated (item master data, or pricelist -->overview) i want to log this information and store it in a user defined table (user, date, item, pricelist, price).
    What is the best way to do this?
    1.Addon : each addon might be a handicap (performance, ...).
    2. SBO Transaction Notification : lots of partners did some codings in this stored procedure and causes lots of problems
    3. B1i: seems to be the best way
    how would you implement such functionality
    best regards
    Markus
    Edited by: Markus Rewak on Sep 11, 2008 3:12 PM

    Hi Mark,
    i would go for 1. or 2.
    but 2. can be very problematic cause when you update the Item you can't really track if
    the price changed.
    so 1. ist the easiest (official) way for me - but only because i've never tried B1i ...
    the easiest forbidden way is to use a trigger on ITM1 table
    lg David

  • Best way of logging data on a cRIO?

    Hi All,
    I have a cRIO 9073.  I want to log measurements periodically to onboard non volatile storage then have an external PC periodically pull these values from the device.  What's the best way of achieving this?
    Thanks,
    Sean

    From the application you will see the nonvolatile RAM as drive C:\. Store the date there.
    Normally an FTP server is running on all LV-RT systems. So you can use any FTP Client program (Windows Explorer is one of it) to get the files.
    There are FTP packes available on the marktet who can do periodic jobs either by using the Task Sheduler from Windows or with an own task sheduler.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • Best way to log/notify when someone logs into ASDM

    What is the best practice to get a notification and log when s
    omeone logs in and uses the ASDM?  I have syslog server setup and smtp, and snmp traps, but not sure where to tell it to notify
    me when someone logs into the asdm..... any suggestions?
    thanks in advance

    There a few ways to accomplish this (if I understand you correctly). You can simply drag the captured clips from the finder into the new projet or you can have multiple projects open at the same time and drag the clips between the bins in the browser. If you're moving clips between computers it's possible you might have to reconnect the clips if you've moved the clips to another drive. Pretty simple, select multiple clips in the browser and control click and choose reconnect. Explore the options in the file requester and you should be able to figure this out.

  • What's the best way to store test parameters for future use?

    I'm creating a test stand that will perform various "standard" tests. Each of the tests has it's own setpoints (integer numbers) as well as some string values that are stored in the log file with the data.
    What is the easiest way to store these setpoints and strings so that I can pull them into the VI in the future, say by selecting a test type from a ring control, etc.?
    I would also like to make this dynamic so that new test types can be stored from the vi. (i.e. I don't want to have to hard code all the future tests and their parameters).

    I like INI files, too. If you are looking for an easy way to read and write your parameters to INI, take a look at the Variant Configuration File IO Library of the OpenG Toolkit.

  • What is the best way to log in in EBS without using browser interface

    Hi,
    I need to log in to EBS without having to use the browser. But I do also need that when user wants to access to some EBS link related to its account, the browser doesn't ask for EBS credentials since 'it has been logged in in the background'.
    Any idea? Is this possible??
    Regards

    Pl continue the discussion in your original thread - Create an EBS Session

  • Best way pass values for in predicate

    Hi all!
    I need subj.
    Sample. select * from store where store_no in (...).
    What is the best way to handle such parameters in sp?
    Temporary tables?
    Dynamic SQL?
    Collections?
    Any suggestions will be appreciated!
    Mike

    To use collections in the INLIST, you should resort to nested table types. Here's a quick example:
    CREATE OR REPLACE TYPE NumTab AS TABLE OF NUMBER;
    -- note that it's an SQL nested table type, not a PL/SQL collection
    PROCEDURE WHATEVER (P_INLIST IN NumTab)
    IS
    L_SOMEVAR NUMBER;
    BEGIN
    SELECT SOMETHING INTO L_SOMEVAR FROM MY_TABLE
    WHERE SOME_COLUMN IN
    ( SELECT * FROM TABLE(CAST(P_INLIST AS NumTab)) );
    END;
    You can call the above procedure, for example, this way:
    WHATEVER( NumTab(1,2,3,4) );
    You can also instantiate the NumTab nested table by BULK COLLECTing into it or simply by assigning values to its elements.

  • What's the best way to check whether a user is logged in or not?

    I have a question about basic session handling.
    I'm running Tomcat 5.0.30 and have a web application where users can register with a username and password, and then log into a "member site".
    What is the best way of making sure that a user actually has logged in or not?
    What I've done in previous applications I've made is that I've just put a simple variable into the users session after he has successfully entered his password (i.e. Boolean loggedIn=true). Then I just test if this flag is true to grant him access to the member site. Is that a smart way of doing it?
    Are there any libraries I can use which handles sessions for me in a secure way?
    All comments and suggestions are appreciated!

    Maintain a flag using session attributes it to one when the user is logs in set it to value.... and change set it zero or invalidate that session... when the user is logged out...
    use something like this while user had logged in
    session.setAttribute("flag",<unique_number>);
    for checking whether the user had logged in or not...
    if(Integer.parseInt(session.getAttribute("flag").toString())=!<unique_number>){
    out.println("The session had expired");
    out.close();
    }

  • I need to know best way to edit MXF files, with least rendering, is that converting the MXF or Log and Transfer? the end product is dvd, but I have lots and lots of these projects to do.

    I am about to comence my Edit, and was told of Mpeg Streamclip, however this doesn't seem to work with my Canon XF305 Clips, the reason I was told to use it was so I wouldn't have to Render in Final Cut Pro all the time.. I do have the Canon Disc with the Plug in Utility and the update from their site.
    Is it best to Convert these MXF files first and import them into FCP or use 'Log and Transfer', so far I am unable to do either!!
    The projects on the timeline will have introduction .Movs already on it as a Template to re-use again and again with the new Footage ( MXF Files ) to be added and edited with transitions etc..This process is repeated again and again but with different MXF clips each time.
      I am looking for the quickest and best way for workflow as there are 80 or more projects to do, each with 10 or so clips to be added to the timeline and Exported for DVD...Will I have to then Compress to fit onto DVD's??
    I know Streamclip is an Mepeg 2 app but I thought the Canon XF305 Shot as mpeg2....
    Is Log and Transfer my only Option?
    Basically I need to know the quickest for Render purposes, and of course, the best way so the files aren't so huge etc etc.
    Please, any suggestions would be greatly received....

    We only work with PR422 files in FC7.  We use Shane's workflow with all 5D & MXF footage.
    Make your life easier and stick to the ProRes family for your footage and edit sequences. Avoid H264 & convert any you have to ProRes.
    Unless you are considering Blu-Ray the only way to deliver video on a DVD is to convert it to SD.
    Depending on the length of your show you can make a Blu-Ray in Compressor but you have very limited authoring options when compared to DVD Studio Pro.
    Compressor can also convert your HD to SD mpg-2 & Ac3 files. The best results usually come from setting the frame controls in the mpg-2 setting of Compressor to best. Depending on the the length of the show and your Qmaster settings this can take quite a while.
    I personally find Compressor's HD to SD DVD conversion varies. Sometimes it is wonderful and sometimes not so much. I prefer the following as it is usually is faster and very consistent.
    Export a quicktime movie (not QT conversion) of your final sequence
    Import the exported HD file back into FC.
    Create a SD 16x9 sequence and then drop in the recently exported HD seq and render. Rendering the sequence basically has FC doing the HD to SD conversion. Export the SD sequence and then convert to mpg-2 & ac3 in Compressor. While this does take time I still find it faster than Compressor with Qmaster utilizing all cores.
    Another option is using jobs in Compressor
    http://pixelcorps.cachefly.net/macbreak-154-540p-h264.mov
    In this workflow you would have Compressor convert the HD file to SD and then through jobs convert the SD file to mpg2 & Ac3. 
    In theory the jobs version could be faster (based on a number of variables- length, Qmaster, etc) but I haven't had time to compare the two. 

  • Best way to extract lines from a log file in Linux

    My query is that I have a log file which is around 7 GB and I want to extract lines between a certain time range which should total up to half of the size to 3.5 GB. The lines start with a time range like                        “2014-03-11 17:35:00”. I want to extract the lines between “2014-03-11 17:35:00” to “2014-03-11 18:05:00”. What should be the best way as there may be a grep command or a sed command to do it.
    I hope, my question is clear.
    Please revert with the reply to my query.
    Regards

    How about the following:
    awk '/2014-03-11 17:35:00/, /2014-03-11 18:05:00/' infile > outfile

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

    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

    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.

Maybe you are looking for