HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- our freopen() output is ending up in syslog ????
Operating System - HP-UX
1837976
Members
2395
Online
110124
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2004 04:26 PM
10-11-2004 04:26 PM
our freopen() output is ending up in syslog ????
This is happening on the same machines for which I posted this question:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=716258
I have an application that uses Java 1.4, via JNI from c++, to communicate using XML via https to retrieve data. Because some of the Java applets I was using write to stdout & stderr I use freopen() to collect this output so it can be written to file with the following code fragment:
_________________
// redirect stdout and stderr to files
// Java tends to pump stuff to stdout/stderr
// It can be useful to collect this in files.
attribute = "WLogDir";
getAttributeValue(attribute, value);
if (value.length() == 0)
value = "/tmp"; // Somewhere we know will exist
string tmpFile1 = value + "/WesCCT_out.log";
string tmpFile2 = value + "/WesCCT_err.log";
freopen(tmpFile1.c_str(), "a+", fdopen(1, "a+"));
freopen(tmpFile2.c_str(), "a+", fdopen(2, "a+"));
_________________
Syslog looks as if it is being written to in “overwrite” mode. It is as if our application writes to syslog and syslog writes to its log replacing the characters at the beginning of the line. (Some of the java output includes unformatted XML leading to loooooooong lines.) Time stamps in the logging indicate that the output is concurrent.
The problem is not consistent. It has been observed on most of the machines where this code is installed but not all. This problem does not occur every time with most runs seeing the output going where it is supposed to.
When the output gets written to syslog it does not get written to where it is supposed to .
I anticipated that a problem of this nature would have shown up previously but I could not find anything on the forums.
System: HP-UX B.11.00 U 9000/800
C++ compiler: aCC
What is going o
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=716258
I have an application that uses Java 1.4, via JNI from c++, to communicate using XML via https to retrieve data. Because some of the Java applets I was using write to stdout & stderr I use freopen() to collect this output so it can be written to file with the following code fragment:
_________________
// redirect stdout and stderr to files
// Java tends to pump stuff to stdout/stderr
// It can be useful to collect this in files.
attribute = "WLogDir";
getAttributeValue(attribute, value);
if (value.length() == 0)
value = "/tmp"; // Somewhere we know will exist
string tmpFile1 = value + "/WesCCT_out.log";
string tmpFile2 = value + "/WesCCT_err.log";
freopen(tmpFile1.c_str(), "a+", fdopen(1, "a+"));
freopen(tmpFile2.c_str(), "a+", fdopen(2, "a+"));
_________________
Syslog looks as if it is being written to in “overwrite” mode. It is as if our application writes to syslog and syslog writes to its log replacing the characters at the beginning of the line. (Some of the java output includes unformatted XML leading to loooooooong lines.) Time stamps in the logging indicate that the output is concurrent.
The problem is not consistent. It has been observed on most of the machines where this code is installed but not all. This problem does not occur every time with most runs seeing the output going where it is supposed to.
When the output gets written to syslog it does not get written to where it is supposed to .
I anticipated that a problem of this nature would have shown up previously but I could not find anything on the forums.
System: HP-UX B.11.00 U 9000/800
C++ compiler: aCC
What is going o
Behold the turtle for he makes not progress unless he pokes his head out.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP