Logging through sockets

Hi
I'm trying to send logging information through sockets using log4j.
My configuration file is :
log4j.rootLogger=Debug, Socket
log4j.appender.Socket=org.apache.log4j.net.SocketAppender
log4j.appender.Socket.Port=12345
log4j.appender.Socket.RemoteHost=localhost
log4j.appender.Socket.LocationInfo=true
the server only reads the input string that the logger sends.
I'm getting this exception on the client side:
log4j:WARN Detected problem with connection: java.net.SocketException: Software caused connection abort: socket write error
and this message on the server:
Server started...
Client accepted
������������org.apache.log4j.spi.LoggingEven�������������

Ryan,
I think if I could log to something common like Microsoft Access it would be a help to me in managing database backups and other things, as Citadel is somewhat unique in its format and methods using the Measurement and Automation Explorer. Maybe I could retrieve data from a 3rd party database back into Citadel if Citadel DB becomes corrupted or lost.
I don't use ODBC logging now, so please excuse me if I come across as lacking in understanding your request. Could the hypertrend or other objects be programmed to log and/or retrieve data to and/or from the 3rd party ODBC database as well?
Terry Parks, Engineering Analyst
Terrebonne Parish Consolidated Government (T.P.C.G.)
Public Works - Pollution Control

Similar Messages

  • Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'

    I'm using the pre-installed versions of php and mysql under Mac OS X Server 10.4.4 running on a G4 and am unable to get anything involving mysql to work.
    I ssh to the server and enter various commands in Terminal:
    on typing "mysql" I get
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)
    and on typing "mysqladmin version" I get
    mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/mysql/mysql.sock' exists!
    On typing "sudo mysqld_safe" I get
    Starting mysqld daemon with databases from /var/mysql
    STOPPING server from pid file /var/mysql/MyServer.local.pid
    070722 16:06:05 mysqld ended
    /var/mysql/MyServer.local.err contains
    070722 16:06:04 mysqld started
    070722 16:06:04 [Warning] Setting lowercase_tablenames=2 because file system for /var/mysql/ is case insensitive
    070722 16:06:04 InnoDB: Database was not shut down normally!
    InnoDB: Starting crash recovery.
    InnoDB: Reading tablespace information from the .ibd files...
    InnoDB: Restoring possible half-written data pages from the doublewrite
    InnoDB: buffer...
    070722 16:06:05 InnoDB: Starting log scan based on checkpoint at
    InnoDB: log sequence number 0 43634.
    /var/mysql has permissions 775.
    The line
    mysql.default_socket = /var/mysql/mysql.sock
    is in /etc/php.ini
    whereis mysqladmin ->
    /usr/bin/mysqladmin
    whereis mysql ->
    /usr/bin/mysql
    ls /var/mysql ->
    MyServer.local.err
    ib_logfile1
    mysql
    ib_logfile0
    ibdata1
    test
    Can't find my.cnf or my.ini anywhere
    Can't find mysql.sock anywhere
    I'm trying to get a bug database running (mantis) under Mac OS X Server 10.4.4 that I can access from local clients.
    I'm trying to follow directions at http://www.mantisbugtracker.com/manual/manual.installation.php
    without knowing anything about mysql or php and I'm stuck on step 3:
    "Next we will create the necessary database tables and a basic configuration
    file."
    I get a message saying
    "Does administrative user have access to the database? ( Lost connection to MySQL server during query )"
    I don't even know if following the mantis directions has resulted in the creation of a database or not. Where would it be?
    Thanks for any help.
    Intel iMac   Mac OS X (10.4.10)  

    I've just done a clean install of OSX Server and added the latest MYSQL packaged installer. Afterwards I found the lock file in /private/tmp/mysql.lock
    The easiest way to solve this problem is to create a symbolic link so that the lock file appears to be in right place.
    e.g.
    cd /var
    sudo mkdir mysql <== this assumes the directory is missing
    cd mysql
    sudo ln -s /private/tmp/mysql.sock mysql.sock
    After this msql commands should work fine, and you've not fiddled with the security settings on users/groups.
    HTH
    Christian

  • ORA-02291 - ORA-02063 on merge with dml error logging through DB link

    Hello all,
    I have 2 DB's and I would like to merge records from A into B with dml error logging through a db link.
    Exemple:
    merge into B@dblink
    using (select ... from A where...)
    when matched then
    when not matched then
    log errors into err$_A reject limit unlimited;
    When I use this, and exception is thrown:
    ORA-02291: integrity constraint (B.constraint_name) violated - parent key not found
    ORA-02063: preceding line from dblink
    I've got no idea of what causes this.
    Could anyone please help me ?
    Thanks !
    Regards,
    TDE.

    Hello damorgan,
    Thanks for your answer.
    I've well understood that its was a foreign key violation, and I guess that's an error in the source: wee make only logical deletes, and I'm quite sure the problem is there.
    Anyway, I really would understand why dml error logging doesn't work in this case.
    I'll investigate and keep you informed.
    Regards.

  • "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"

    Data Services=3.1
    Repository=12.2.2.0000
    Red Hat Enterprise 5
    Designer,Job Server,Job Engine=12.2.2.3
    After an unscheduled server reboot with DS up and running when trying to start a job in either Data Services Management Console or DS Designer getting the following:
    "Can't connect to local MySQL server through socket '/tmp/mysql.sock'"
    The mysql.sock have never been in /tmp and on the production server it does not exist there and the production server is up and running correctly. If a link is created to mysql.sock(/home/user/boedge31/bobje/mysql) the job will start but return this message: 
    "Cannot retrieve <Version> from the repository. Additional database information: <SQL submitted to ODBC data source <localrepo> resulted in error <MySQL ODBC 3.51 Driver mysqld-5.0.46-enterprise No database selected>. The SQL submitted is <select VERSION, SECURITYKEY, GUID from AL_VERSION where NAME = 'Repository Version'"
    I checked and AL_VERSION and the Version field exist. 
    Before the shut down DS was working correctly and had no issues.  My best guess is a part of the repository was corrupted during the unscheduled shut down.  It seems like DS has "forgotten" some of the settings.  
    Any suggestions on a possible solution?

    The issue has been solved. 
    There was a bad path in $LD_LIBRARY_PATH.
    Removed the path and DS started working again.

  • Transfering a file through Socket programming

    Hi all,
    I want to return a file from server to client through a socket. I tried using ObjectOutput Stream where in I returned a java.io.File from server. But at client side when I say file.getLeangth() it comes as 0 and if I try to assign FileInputStream on the object it throws an exception as the file not found as the path associated with the file will be of Server.
    So can anyone help as to how to transfer a file through socket programming???
    thx in advance
    MK

    java.io.File is NOT the contents of the file. It really just represents the path.
    If you want to transfer the file's contents, you'll have to use a FileInputStream or FileReader, read from it, and then write the bytes or chars on the wire.

  • Am I able to view the text message log through Verizon Mobile? I can view it from my computer, but have not been able to locate it on Verizon Mobile from my phone.

    Am I able to view the text message log through Verizon Mobile? I can view it from my computer, but have not been able to locate it on Verizon Mobile from my phone.

    The logs are only available through the desktop version of My Verizon.

  • Problem in passing byte through socket

    Hi to all,
    I'm trying to pass a byte[] through socket.
    The code where the data is sent is the following:
    byte[] data = new byte[len];
    // read the byte[] from another InputStream
    inStream.read(data, 0, len);
    // carry data to another OutputStream
    handler.out.println("$crypted_obj "+len+" "+pcol_step); //handler.out is a PrintWriter
    handler.incoming.getOutputStream().write(data);
    handler.incoming.getOutputStream().flush();I try to read in this way:
    byte[] data = new byte[len];
    is.read(data, 0, len);When the read is launched for the first time, it return only an array full of zeros, the other times return the right data array.
    I have tried to use BufferedInputStream and BufferedOutputStream but it's the same.
    In debugging mode(Eclipse) all work fine.
    Anyone have a suggestion for solve this problem?
    Thanks in Advice
    Manuel

    But why the sender don't write the bytes?Because the length is wrong, or you have a bug in your sending code which you haven't posted yet.
    Before of the byte[] data I sent a string through a PrintWriter that work on the same OutputStream. The string arrive correctly.Don't use two kinds of streams or Readers or Writers on the same stream. It doesn't work.
    os.write(data); //this is not sent!It is if you flush it.

  • Data are not transfered as unicode through sockets

    I have aplication with connection through sockets. I use PrintWriter and BufferedReader for writing and reading data, created lik this:
    pw = new PrintWriter( skt.getOutputStream(), true );
    br = new BufferedReader( new InputStreamReader( skt.getInputStream() ) );
    When I send data I put this code for checking:
    int tmpSize = str.length();
    for( int i = 0; i < tmpSize; i++ )
         char chr = str.charAt( i );
         int tmpInt = (int)chr;
         System.out.print( tmpInt + " " );
    System.out.println();
    pw.println( str );
    And when I receive data I put something similar with string read with
    br.readLine().
    For unicode characters the result is different ( I use ascii and russian characters ). At sending data, it is normal, and at receiving I get '?' instead of unicode characters, something like this
    109 101 115 115 58 98 108 117 101 58 32 1092 1099
    before sending data and this
    109 101 115 115 58 98 108 117 101 58 32 63 63
    after receiving.
    Can somebody help me with this, or it is a bug?

    Ok, I just solved it. I had to create reader and writer like this:
    pw = new PrintWriter( new OutputStreamWriter( skt.getOutputStream(), "UTF-16" ) );
    br = new BufferedReader( new InputStreamReader( skt.getInputStream(), "UTF-16" ) );
    Seems that default encoding set was not unicode even if it is Writer and Reader!

  • Connecting to localhost through socket

    Hi Friends
    I want to connect to the localhost (wamp server) and need to read the video file byte by byte through socket please help me to find out the solution.
    Thanks
    Sam

    Turn off your Firewall
    wamp use generally the port 80
    Can you tell more about your problem?

  • MySQL can't connect through socket error

    I have been mucking around with MySQL and have broken something.
    Running 10.4.3 server, I get a "Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)" error
    Was working fine before I decided to mess with things - I think I altered the hostname from localhost to 192.168.x.x etc.
    Now I cannot connect, and MySQL manager won't start it. I would like to make it work again rather than have to install a different version.
    When MySQL manager installs the requisite files for the first time, where does it store these, and how can I do this again?
    Thanks
    Hamish

    There's an issue with authentication between PHP 5 and MySQL 4.1
    This thread should contain a resolution for you.
    http://discussions.apple.com/thread.jspa?messageID=665175&#665175
    FYI- A search here for "MySQL PHP socket" reveals the above thread and other threads with the same issue.
    Jeff

  • Getting the error message while logging through work place after upgrade

    Hi,
    C:\Documents and setting\YP80002\Local Settings\Temporary Internet files\Content.IE5\GTKFGH6L\tx[2].sap
    Application not found
    Getting the error message while logging through work place.
    It is urgent
    Thanks,
    Sri.

    After upgrading the Batch file it worked fine.
    Thanks,
    Sri.

  • File thansfer through socket problem

    i am writing server /client program, where the server wait for client request to send or receive file through socket.
    can i use 1 socket to handle the request (client want to send or download file) and file data transfer?
    if yes, how to handle the beginging of file transfer after receive a request?
    and how can server know when the file transfer is completed?

    This tutorial should help:
    http://java.sun.com/docs/books/tutorial/networking/index.html

  • Is there a way to get more detailed information through web history logs through the router

    I have several people living in my household and connected to my router. I want to know if there is a way to get more specifics from my history log through my wireless connection. I own a cisco linksys modem and router and would like to know how to access that kind of information or if there is a way of doing so. Is there a software you can use to connect to your router done way or any way to use your router to get more information than what is presented through the logs as they are?

    Hi Crimsonrain,
    What is the model number of your router? 

  • File reading through Sockets???

    Hello,
    My application has a server and it has to read a file that is sent by the client.. how can the server read a file sent by the client through sockets?????
    Edited by: s_coder on Feb 19, 2009 11:20 PM

    s_coder wrote:
    Yes i read it but there input is given from the client to the server through the standard input stream.... how can i transfer a file thru the standard input stream? and the accept it at the server side???Come on mate. You need to be able to add two and two on your own.
    WTF is a "standard input stream"? And why if you followed the tutorial can you not figure out how to send the data of a file through a socket?
    Either you didn't really read the tutorial or you're pretty darn hopeless. Why don't you try and really follow the tutorial, not just glance at each page but understand what it is saying. Then make an attempt to write your program and if you get stuck come back with your code. Be sure to use the code formatting tags when you show us your code.

  • Send a message through socket

    Hi
    I want to send a MIMEMessage through socket. And want to receive the same.
    Could any one help me out ?

    Hi
    I proceed that thing.
    I am getting the problem while converting the input stream from socket to MIME message.
    I am getting prob at following line.
      //soc is the object of Socket
      Session session =Session.getDefaultInstance(new Properties(), null);
      MimeMessage l_msg = new MimeMessage(session, soc.getInputStream());When I read the input stream from the file.
    It works successfully. But when I try to get it from socket not doesn't work.
    It's not showing any error also. So I am not able to track the actual error.
    Could you please tell me why it is not working.
    Thanks
    Anmolb

Maybe you are looking for