How to get the log information when using a class?

Hi All,
I have a simple question, which I don't know how to solve. I am using org.apache.commons.logging.Log and LogFactory to do some logging. A typical situation is exemplified in the following code snippet.
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
class LogClass {
    private static final Log LOG = LogFactory.getLog(AClass.class);
    public void logit(){
        LOG.debug("This is the debugging log.");
public class AClass{
    public static void main(String[] args) {
        LogClass l=new LogClass();
        l.logit();
}But this way, I do not get the log information from the class LogClass. Could anybody please help?
Many thanks.

jschell wrote:
jverd wrote:
...configuration in log4j.xml or log4j.properties.And far as I recall you need one of those two also. If there is no config then there is no output.I thought it used some default config if no file is present, but I could be mistaken. Either way, it adds to the possible problems that the OP could be having, any of which are consistent with his rather vague question.
1) He's passing the wrong class to the LogFactory, and hence getting a logger with the wrong name, so he's seeing a different name than he expects in the output that's being produced.
2) His config file does not contain the proper format to include the actual classname, independent of the logger's name, so he's missing a piece of desired information in each line of the output that's being produced.
3) His config file indicates a threshold that's less verbose than the level at which his code is logging, so no output is present when he wants it.
4) His config file is missing (or not where it's expected to be), so no output is being produced at all.
5) His config file is missing (or not where it's expected to be), so a default level or format is being produced, effectively the equivalent of one of the misconfigurations described in #2 and #3.
Since the OP seems to have vanished, we may never know.

Similar Messages

  • How to get the line information when double click the ALV line?

    LOOP AT it_outr.
        AT END OF vornr.
          REFRESH it_out.
          CLEAR it_out.
          LOOP AT it_outt WHERE nplnr = it_outr-nplnr
                            AND vornr = it_outr-vornr.
            MOVE-CORRESPONDING it_outt TO it_out.
            APPEND it_out.
          ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = 'HANDLE_EVENT_PF_STATUS'
          i_callback_user_command  = 'HANDLE_EVENT_USER_COMMAND'
          is_layout                = ls_layo
          it_fieldcat              = lt_fcat
          it_events                = lt_evts1
          is_print                 = ls_prnt
        TABLES
          t_outtab                 = it_out
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
        ENDAT.
    When we double click a field, how do we get the line information with the field?
    READ TABLE it_out INDEX rs_selfield-tabindex. is not worked, because the table it_out is changing.

    hi
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
    *   I_CALLBACK_PF_STATUS_SET          = ' '
         *I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'*
    *    I_CALLBACK_TOP_OF_PAGE            = ''
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
       I_BACKGROUND_ID                   = 'ALV_BACKGROUND'
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
         IS_LAYOUT                          = LAYOUT
         IT_FIELDCAT                        = RT_FIELDCAT
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =  'X'
    *   IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = 'A'
         IS_VARIANT                        = G_VARIANT
         IT_EVENTS                         = XT_EVENT
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_FINAL
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CASE U_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_FINAL INDEX US_SELFIELD-TABINDEX INTO WA_FINAL.
          CHECK SY-SUBRC EQ 0.
          CASE US_SELFIELD-FIELDNAME.
            WHEN 'VBELN'.
              SET PARAMETER ID: 'VF' FIELD WA_FINAL-VBELN.
              CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
          ENDCASE.
          ENDCASE.
    regard,
    nawa

  • How to get the Mobile information by using J2ME application

    hi all,
    I am lakshman.I am developing an application in j2me,I want my program compatible to all mobile devices.
    I want to know properties and the device information with the help of a j2me application.I got the information with the help of System.getProperty(String).I found some of the information like sms,videocapture,and some of the values and the variables ... in the following
    platform...null
    encoding...ISO-8859-1
    configuration...CLDC-1.0
    profile...MIDP-2.0
    locale...null
    fileconnection...1.0
    comport...null
    hostname...iwmc-07
    sms...null
    smartcard...null
    location version...null
    sip version...null
    m3gversion...null
    mms...null
    videocapture...false
    videoencoding...null
    snapshotencoding...encoding=png encoding=jpeg encoding=gif encoding=bmp
    audioencoding...null
    supaudcap...false
    suprecod...false
    supmixing...false
    mediaversion...1.1
    streamcont...null
    I want to know these are the only variables or is there are lot...
    Now my question is I want to get the information of the service provider and also the present location that the mobile was present.I think there was some method to get that ...I want to get what firmware it was using .
    Can anybody tell me that way and also the package to get the information
    thanks in advance
    lakshman

    hi all,
    I am lakshman,I found the answer for my question,By using the Location API(jsr179).It was not include in the WTK2.2.for that i have downloaded the WTK2.3 then i have implemented the location api in the application and it was working.
    And I have the following warning...
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    I am running the application from my Emulator(by using the default color phone).I have to check that in the device.
    Can any body please give me the way to fix that,i want to test my application from my emulator is that is possible if possible ...how?.what is the procedure to implement..
    thanks in advance

  • How to get the displayed message when using FM:  ABAP4_CALL_TRANSACTION

    Hi, 
    I am calling FM ABAP4_CALL_TRANSACTION from MS-Excel.  This FM works perfectly for me except the system messages that SAP returns are not always understandable or intituative.  My question is there another FM or Table that I can use to convert the data from MESS_TAB to a more meaningful message for the users?
    Examples listed below:
    Normal T-Code Message
    FM Message in MESS_TAB
    Real Meaning
    Fill in all required entry fields
    COBL-RMVCT        
    Field COBL-RMVCT is a required field
    Document 400000000 was posted in 130
    4000000000 130
    Document 400000000 was posted successfully
    Thanks for your Help

    Hi Karim,
    when you have the parameter to generate the message, you can use the following RFC function module:
    BAPI_MESSAGE_GETDETAIL
    The module has the following interface:
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     VALUE(ID) LIKE  BAPIRET2-ID
    *"     VALUE(NUMBER) LIKE  BAPIRET2-NUMBER
    *"     VALUE(LANGUAGE) LIKE  BAPITGA-LANGU DEFAULT SY-LANGU
    *"     VALUE(TEXTFORMAT) LIKE  BAPITGA-TEXTFORMAT
    *"     VALUE(LINKPATTERN) LIKE  BAPITGA-LINKMASK OPTIONAL
    *"     VALUE(MESSAGE_V1) LIKE  BAPIRET2-MESSAGE_V1 OPTIONAL
    *"     VALUE(MESSAGE_V2) LIKE  BAPIRET2-MESSAGE_V2 OPTIONAL
    *"     VALUE(MESSAGE_V3) LIKE  BAPIRET2-MESSAGE_V3 OPTIONAL
    *"     VALUE(MESSAGE_V4) LIKE  BAPIRET2-MESSAGE_V4 OPTIONAL
    *"  EXPORTING
    *"     VALUE(MESSAGE) LIKE  BAPIRET2-MESSAGE
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      TEXT STRUCTURE  BAPITGB OPTIONAL
    Best regards
    Thomas

  • Quick question: How to get the scrolled page number using af:table

    Hi,
    When using range paging on scrolled table, how to get the current scrolled page number(1,2,3...), for example when moving the table vertical scroll bar forward or backward, is there any method in ViewObjectImpl class that I can use to get such information? I have seen the method scrollToRangePage(int i), but when scrolled ("Fetching data..."), it doesn't not get into this method. So it is wrong usage for this method, right?
    Thanks

    Didn't you just ask that question in this thread?: How to catch the page number when using scroll table in ADF 11g?
    A bit of patience might be in order.
    CM.

  • How to get the Useru2019s position when the user doesnu2019t have CP relation

    We have a custom program which will add / delete attributes (In transaction PPOSA_BBP). It is working fine for users which were assigned with CP relation But it fails for users which doesnu2019t have CP relation (since we are getting the position of users form HRP1001 then we are retrieving the existing attributes based on the position after that updating the attributes) as we are getting the position from HRP1001 it fails for users were no CP relation.
    Help us how to get the Useru2019s position when the user doesnu2019t have CP relation. Suggest us any function module or how to query the HRP1001 or some other table if exists
    Regards
    Paul

    Hi Paul,
    Have a look at these tables.
    Using table BUT000 the central business partner data are stored, f.e. partner type, partner names, partner number, partner guid, person number, etc. In table BUTBKK the bank data to a business partner are stored.
    Central business partner address data
    The table ADRC is used for the address of a business partner. Table BUT020 links the business partner number with the address number. Using table BUT021 several addresses to a business partner with different usages (modes), f.e. correspondence or delivery address, can be stored. The personal data of a business partner person are stored with key person number in table ADRP. The person number is assignd to a business partner person in table BUT000. Communication data of business partners as e-mail, telephone, fax, etc. are stored in the tables ADDR1 u2013 ADDR12. The business address of a contact person or an employee consists of the organization address (company resp. org.-unit) and of an address addition, which describes f.e. a building, a room number, etc. The address addition is stored in table ADCP and is identified by the keys address number of the organization address and person number.
    Relationships between business partners
    Table BUT050 contains the relationships between a business partner organization and a business partner person using relation types. The relation types are defined in table TBZ9, f.e. the relation type u2018has employeeu2019 corresponds to identifier u2018BUR010u2019, the relation type u2018has contact personu2019 corresponds to identifier u2018BUR001u2019. Table BUT051 stores communication data of a contact person relationship (compare to table ADCP). Table BUT052 stores several address numbers to one business partner relationship (including a standard flag).
    Hope this helps,
    Kind Regards,
    Matthew

  • How to get the logged in userId value in adf task flow OIM11g R2

    Hi,
    I have created an adf task flow. Now I want to run some query in that based on the logged in userId.
    Could you please help me in knowing how to get the logged in userID value in adf TaskFlow so that I can run a parameterized query.
    Thanks

    3 different ways to retrieve the username (not sure what you mean by user ID) :
    http://mahmoudoracle.blogspot.be/2012/06/adf-get-current-logged-user-name.html#.USI_c-h8zIo
    Also provide your JDev version.
    Basicly, you should use the groovy expression in a view criteria (it's the fastest and easiest way) and call that view criteria whenever you need it.
    That's if you are using ADF BC of course.

  • I tunes has stopped working in windows 7 and I don't know how to get the crash information that everyone else seems to get to know what the cause is....any help?  I have a toshiba windows 7 computer.

    I have a toshiba computer and it is windows 7, recently after I installed imatch everytime I open itunes I get the message 'i tunes has stopped working' and windows cannot find a solution and has to close.  There is no solution and I don't know how to get the crash information on my computer....can anyone help as I want to finish downloading all my songs to match to be available on my mac products.

    Re: That garbage is unreadable.
    If you really want help, stop messing with the fonts and post so that others can read and offer suggestions.
    Or better yet... try a search, I'm certain you'll find a solution to whatever issue you're experiencing.
    I have found that many times it is the things that make you most angry that push you to action. This was the case here. Thank you for causing me to get so angry that I found the answer myself.

  • How to get the search option when we are creating new view

    Hi,
    How to get the search functionality when we are creating new view.
    Ex:- if we see the standard component BT112S_SC. Under this
    AdvancedSP  is the view,
    same kind of view if i want to create new view with same bol entity in my new component. I am unable to get that search functionality.
    for search functionality,,i think view should inherit the super class CL_BTSRV_ADVS_CNTRL, but in my new view controller class, i am unable to find this class.
    Can anybody give me some inputs on this.
    Thanks,
    neelam

    In case you are still not able to proceed please refer the following blog.
    http://blogs.moovar.com/sap/sap-crm-web-ic-create-a-new-search-view-and-result-view
    Regards,
    Harshit

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • DBMS_DATAPUMP; how to get the log file of a job?

    Hi
    I want the user to be able to see the logfile of his job from another session.
    this is my procedure
    create or replace procedure get_job_log (p_job_name IN varchar2 )
    is
    hdl_job  number;
    l_job_state     VARCHAR2 (20);
    l_status        sys.ku$_Status1010;
    l_job_status    sys.ku$_JobStatus1010;
    l_job_logentry sys.ku$_LogEntry1010;
    l_job_logline  sys.ku$_LogLine1010;
    begin
    hdl_job := DBMS_DATAPUMP.ATTACH(
                                         job_name   => p_job_name
                                        ,job_owner  => 'CLONE_USER'
    DBMS_DATAPUMP.GET_STATUS(
       handle  => hdl_job
       ,mask   => dbms_datapump.ku$_status_job_error + dbms_datapump.ku$_status_job_status + dbms_datapump.ku$_status_wip
       --,timeout   => 15
       ,job_state =>l_job_state
       ,status    =>l_status);
    l_job_logentry:=l_status.wip ;
    for x in l_job_logentry.first .. l_job_logentry.last loop
       dbms_output.put_line (l_job_logentry(x).LogText) ;
    end loop;
    dbms_datapump.detach(hdl_job);
    end;
    /when I run it for the first time, it works... kindof...
    but my problem is that if I try running it again I get:
    ORA-31626: job does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 902
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3407
    if I close sqlplus session , open new one and run - it works. So what is the issue here? Is detach not enough? What else should I do?
    my version is 11.1.0.6
    UPDATE.
    Looks like the above is not true. It doesn't error if it runs to the end of code... The problem seems to happen only when exception occures and .detach is not called. So this is not an issue anymore.
    But I still don't get a decent performance from the .get_status function. Sometimes it just hangs and errors on timeout.
    Still the question is: How can I get the LOG of the session using DBMS_DATAPUMP from another session and output it on the screen?...
    Edited by: Andrei Kübar on Dec 23, 2011 12:44 PM
    Edited by: Andrei Kübar on Dec 23, 2011 12:57 PM

    I believe I found a solution
    I am now running the above code only 1 time but in a loop and inserting output into a table, so that user can query the table and see where the job is
    here's the code I'm using (partially copied from http://psoug.org/reference/dbms_datapump.html)
    l_job_state:='UNDEFINED';
    while (l_job_state != 'COMPLETED') and (l_job_state != 'STOPPED') loop
         DBMS_DATAPUMP.GET_STATUS(
            handle  => hdl_job
           ,mask   => dbms_datapump.ku$_status_job_error + dbms_datapump.ku$_status_job_status + dbms_datapump.ku$_status_wip
         --,timeout   => 15
           ,job_state =>l_job_state
           ,status    =>l_status);
         if (bitand(l_status.mask,dbms_datapump.ku$_status_wip) != 0) then
           l_job_logentry:=l_status.wip ;
           if (l_job_logentry is not null) then
                for x in l_job_logentry.first .. l_job_logentry.last loop
                    --dbms_output.put_line (l_job_logentry(x).LogText ) ;
                    writelog (l_job_logentry(x).LogText );
                end loop;
           end if;
         end if;
         if (bitand(l_status.mask,dbms_datapump.ku$_status_job_error) != 0) then
            l_job_error :=l_status.error ;
            if  (l_job_error is not null) then
                for x in l_job_error.first .. l_job_error.last loop
                    dbms_output.put_line (l_job_error(x).LogText) ;
                    writelog('Error: '|| l_job_error(x).LogText) ;
                end loop;
            end if;
         end if;
         --dbms_output.put_line ('Current job state: '||l_job_state);
         writelog ('Current job state: '||l_job_state);
    end loop;thanks all for your help

  • How to get the full pictures, when only a strip of it is seen?

    When Yahoo India web page is viewed through Mozillz firefox 4.0.1 the photos in the gallery are seen only as a small strip and not fully. How can I correct this defect?

    Hi
    1. I want to get the mail statuses of the invoice mail sent to a customer.
    2. In which table the log will be stored ?
    3. How to get the link for the billing document for which the mail was sent to the customer ?
    What do you mean?
    How do you manage the mail?
    I suppose you manage it by a messages, if it's so you can have 2 different status:
    - One for the message: check table NAST
    - One for mail: see transaction SOST
    The link is in NAST table
    Max

  • IPhone SDK: UIWebView - How to get the anchor information from  URLRequs

    I was planning to use the UIWebView but i am stumped now.
    When the user clicks on a hyperlink, the web view delegate shouldStartLoadWithRequest is called and it does not contain the anchor information.
    For e.g. if the href is say #01_02. This to a normal browser is a local anchor. The URL in the NSURLRequest contains just the file name information not the anchor.
    In my particular case a anchor can be some other view of the topic which i will generate and keep it ready for the browser at this point. But since i don't get the anchor information it just shows the current page.
    Is there a way to get the original value encoded in the HREF?
    Thanks in advance,
    -TRS

    I may not have understood your question but if you want to pull out the anchor information out of a request, have you tried the fragment property of the NSURL object?
    // request is type (NSURLRequest *); within shouldStartLoadWithRequest
    NSString *fragment = \[\[request URL\] fragment\];
    Usually this will have the anchor without the #, in your case 01_02.

  • How to get the copyright information for an image?

    How would I get the copyright data from an image in the DAM?

    Assuming you are using image component[1] on a page and copyright is a string.    As a sample you could use [2] to get the copyright information.  I am not well versed with the API as there might be an better option to implement. But this just gives you an idea for the information you were looking for.
    [1] /libs/foundation/components/image/image.jsp
    [2]
    Node refNode = resource.getResourceResolver().getResource(ResourceUtil.getValueMap(resource).get("fileRe ference","")).adaptTo(Node.class);
    String copyRight = refNode.getNode("jcr:content/metadata").getProperty("dc:rights").getString() ;

  • How to get the logged in username or how to set the acquiredby?

    We are using BPEL 10.1.2.0.2.
    We have implemented CAS/OID to work with the TaskList. Our issue is with obtaining the logged in username while in the BPEL Workflow. Acquired by variable is not populated even after the task is acquired. Explicitly setting Acquired By doesn't work either (still comes as null).
    This might be something quite simple, but I am not able to figure it out. Is there a way to get the logged in username or the user who acquired the task while in the BPEL workflow?
    Thank you!

    I have no longer access to the custom worklist application of 10.1.2 but in 10.1.3 you can access it through:
    SessionStore sessStore = SessionStore.getInstance(request.getSession(false));
    String userName = ((IWorkflowContext) sessStore.get(WorklistappConstants.SESS_ATTR_WORKFLOW_CONTEXT)).getUser();Kind Regards,
    Andre

Maybe you are looking for

  • How do I stop my itunes/iPhone from making multiple Purchased on iPhone categoreies?

    Just like the question states.......... It's getting pretty aggravating...

  • Doubt in Decode and Using Temporary variable

    I was facing the following issue, For example, The column_name if A should be stored with the value B or, with itself for which I included a statement as following, Case [1] SELECT ....DECODE(column_name,'A','B',column_name) alias_name      FROM tabl

  • OWB9i as Data Modelling tool

    I was told that OWB9i can also be used as Data Modelling tool. Assume we had developed DWH using Bus Architecture. Now How can I see the entire scehma that contains all Facts and Dimensions with their attributes and measures with primary key and Fore

  • LSMW for GARNISHMENTS

    hi frenz... i am doing LSMW for 195(garnishment order). while recording it is not allowing me to enter in to 195 unless i enter in 194. i dont want to do for 194.. i want to do directly for 195. plzz help me.

  • Need to copy files to path that contains a wildcard!??!

    Afternoon, I am attempting to copy a set of files to multiple computers on the network (files are at a dfs link, no issue there). The destination path on each computer is either: "\\$computer\c$\Program Files\AASHTOWare\Trns·port Client-Server PES-LA