Make configure script check for proper logging version.
if test -f "${LOG4SHIB_CONFIG}"; then
LDFLAGS="`${LOG4SHIB_CONFIG} --libs` $LDFLAGS"
CPPFLAGS="`${LOG4SHIB_CONFIG} --cflags` $CPPFLAGS"
- AC_CHECK_HEADER([log4shib/Category.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
+ AC_CHECK_HEADER([log4shib/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4shib header files]))
AC_TRY_LINK(
- [#include <log4shib/Category.hh>],
- [log4shib::Category::getInstance("foo")],
+ [#include <log4shib/CategoryStream.hh>],
+ [log4shib::Category::getInstance("foo").errorStream() << log4shib::eol],
[AC_DEFINE(HAVE_LOG4SHIB,1,[Define if log4shib library is used.])],
[AC_MSG_ERROR([unable to link with log4shib])])
else
AC_MSG_WARN([will try to use log4cpp, note that most non-Internet2 supplied versions are not thread-safe])
LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
- AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
- AC_CHECK_HEADER([log4cpp/PropertyConfigurator.hh],,AC_MSG_ERROR([you need at least log4cpp 0.3.x]))
+ AC_CHECK_HEADER([log4cpp/CategoryStream.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
AC_TRY_LINK(
- [#include <log4cpp/Category.hh>],
- [log4cpp::Category::getInstance("foo")],
+ [#include <log4cpp/CategoryStream.hh>],
+ [log4cpp::Category::getInstance("foo").errorStream() << log4cpp::eol],
[AC_DEFINE(HAVE_LOG4CPP,1,[Define if log4cpp library is used.])],
- [AC_MSG_ERROR([unable to link with log4cpp])])
+ [AC_MSG_ERROR([unable to link with log4cpp, at least version 1.0 needed])])
else
AC_MSG_ERROR([log4cpp-config not found, may need to use --with-log4cpp option])
fi
try {
response = binding->send(ep->getLocation(),*request,&callCtx);
if (log.isDebugEnabled())
- log.debugStream() << "SAML response from artifact request:\n" << *response << CategoryStream::ENDLINE;
+ log.debugStream() << "SAML response from artifact request:\n" << *response << logging::eol;
if (!response->getAssertions().hasNext()) {
delete response;
try {
response = binding->send(ep->getLocation(),*request,&callCtx);
if (log.isDebugEnabled())
- log.debugStream() << "SAML response from artifact request:\n" << *response << CategoryStream::ENDLINE;
+ log.debugStream() << "SAML response from artifact request:\n" << *response << logging::eol;
if (!response->getAssertions().hasNext()) {
delete response;
istringstream authstream(ret.auth_statement);
log.debugStream() << "trying to decode authentication statement: "
- << ((ret.auth_statement && *ret.auth_statement) ? ret.auth_statement : "(none)") << CategoryStream::ENDLINE;
+ << ((ret.auth_statement && *ret.auth_statement) ? ret.auth_statement : "(none)") << logging::eol;
auto_ptr<SAMLAuthenticationStatement> s(
(ret.auth_statement && *ret.auth_statement) ? new SAMLAuthenticationStatement(authstream) : NULL
);
istringstream prestream(ret.attr_response_pre);
log.debugStream() << "trying to decode unfiltered attribute response: "
- << ((ret.attr_response_pre && *ret.attr_response_pre) ? ret.attr_response_pre : "(none)") << CategoryStream::ENDLINE;
+ << ((ret.attr_response_pre && *ret.attr_response_pre) ? ret.attr_response_pre : "(none)") << logging::eol;
auto_ptr<SAMLResponse> pre(
(ret.attr_response_pre && *ret.attr_response_pre) ? new SAMLResponse(prestream,minor) : NULL
);
istringstream poststream(ret.attr_response_post);
log.debugStream() << "trying to decode filtered attribute response: "
- << ((ret.attr_response_post && *ret.attr_response_post) ? ret.attr_response_post : "(none)") << CategoryStream::ENDLINE;
+ << ((ret.attr_response_post && *ret.attr_response_post) ? ret.attr_response_post : "(none)") << logging::eol;
auto_ptr<SAMLResponse> post(
(ret.attr_response_post && *ret.attr_response_post) ? new SAMLResponse(poststream,minor) : NULL
);
}
}
catch (SAMLException& e) {
- log->errorStream() << "Error while parsing request mapping configuration: " << e.what() << CategoryStream::ENDLINE;
+ log->errorStream() << "Error while parsing request mapping configuration: " << e.what() << logging::eol;
throw;
}
#ifndef _DEBUG
}
}
catch (SAMLException& e) {
- log.errorStream() << "Error while processing applicaton element: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while processing applicaton element: " << e.what() << logging::eol;
cleanup();
throw;
}
}
}
catch (SAMLException& e) {
- log.errorStream() << "Error while loading SP configuration: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while loading SP configuration: " << e.what() << logging::eol;
throw;
}
#ifndef _DEBUG
m_doc=p.parse(dsrc);
m_root=m_doc->getDocumentElement();
- log.infoStream() << "Loaded and parsed XML file (" << pathname << ")" << CategoryStream::ENDLINE;
+ log.infoStream() << "Loaded and parsed XML file (" << pathname << ")" << logging::eol;
}
catch (XMLException& e)
{
auto_ptr_char msg(e.getMessage());
- log.errorStream() << "Xerces error while opening configuration file (" << pathname << "): " << msg.get() << CategoryStream::ENDLINE;
+ log.errorStream() << "Xerces error while opening configuration file (" << pathname << "): " << msg.get() << logging::eol;
if (m_doc) {
m_doc->release();
m_doc=NULL;
}
catch (SAMLException& e)
{
- log.errorStream() << "XML error while parsing configuration file (" << pathname << "): " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "XML error while parsing configuration file (" << pathname << "): " << e.what() << logging::eol;
if (m_doc) {
m_doc->release();
m_doc=NULL;
#ifndef _DEBUG
catch (...)
{
- log.errorStream() << "Unexpected error while parsing configuration file (" << pathname << ")" << CategoryStream::ENDLINE;
+ log.errorStream() << "Unexpected error while parsing configuration file (" << pathname << ")" << logging::eol;
if (m_doc) {
m_doc->release();
m_doc=NULL;
unsigned long code=ERR_get_error_line_data(&file,&line,&data,&flags);
while (code) {
Category& log=Category::getInstance("OpenSSL");
- log.errorStream() << "error code: " << code << " in " << file << ", line " << line << CategoryStream::ENDLINE;
+ log.errorStream() << "error code: " << code << " in " << file << ", line " << line << logging::eol;
if (data && (flags & ERR_TXT_STRING))
- log.errorStream() << "error data: " << data << CategoryStream::ENDLINE;
+ log.errorStream() << "error data: " << data << logging::eol;
code=ERR_get_error_line_data(&file,&line,&data,&flags);
}
}
buf[len] = '\0';
subjectstr+=buf;
}
- log.infoStream() << "certificate subject: " << subjectstr << CategoryStream::ENDLINE;
+ log.infoStream() << "certificate subject: " << subjectstr << logging::eol;
// The flags give us LDAP order instead of X.500, with a comma plus space separator.
len=X509_NAME_print_ex(b2,subject,0,XN_FLAG_RFC2253 + XN_FLAG_SEP_CPLUS_SPC - XN_FLAG_SEP_COMMA_PLUS);
BIO_flush(b2);
ret=-1;
}
catch(SAMLException& e) {
- log.errorStream() << "caught a SAML exception: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught a SAML exception: " << e.what() << siterefresh::logging::eol;
ret=-2;
}
catch(XMLException& e) {
auto_ptr_char temp(e.getMessage());
- log.errorStream() << "caught an XML exception: " << temp.get() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught an XML exception: " << temp.get() << siterefresh::logging::eol;
ret=-3;
}
catch(XSECException& e) {
auto_ptr_char temp(e.getMsg());
- log.errorStream() << "caught an XMLSec exception: " << temp.get() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught an XMLSec exception: " << temp.get() << siterefresh::logging::eol;
ret=-4;
}
catch(XSECCryptoException& e) {
- log.errorStream() << "caught an XMLSecCrypto exception: " << e.getMsg() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught an XMLSecCrypto exception: " << e.getMsg() << siterefresh::logging::eol;
ret=-5;
}
catch(...) {
- log.errorStream() << "caught an unknown exception" << CategoryStream::ENDLINE;
+ log.errorStream() << "caught an unknown exception" << siterefresh::logging::eol;
ret=-6;
}
}
catch (SAMLException& e)
{
- log.errorStream() << "Error while parsing AAP: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while parsing AAP: " << e.what() << xmlproviders::logging::eol;
this->~XMLAAPImpl();
throw;
}
{
auto_ptr<char> tmp(XMLString::transcode(ex.getMessage()));
Category::getInstance(XMLPROVIDERS_LOGCAT".XMLAAPImpl").errorStream()
- << "caught exception while parsing regular expression: " << tmp.get() << CategoryStream::ENDLINE;
+ << "caught exception while parsing regular expression: " << tmp.get() << xmlproviders::logging::eol;
}
return false;
}
m_rootAuthz=new Operator(rootElement);
}
catch (SAMLException& e) {
- log->errorStream() << "Error while parsing access control configuration: " << e.what() << CategoryStream::ENDLINE;
+ log->errorStream() << "Error while parsing access control configuration: " << e.what() << xmlproviders::logging::eol;
throw;
}
#ifndef _DEBUG
}
}
catch (SAMLException& e) {
- log.errorStream() << "Error while parsing creds configuration: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while parsing creds configuration: " << e.what() << xmlproviders::logging::eol;
for (resolvermap_t::iterator j=m_resolverMap.begin(); j!=m_resolverMap.end(); j++)
delete j->second;
throw;
}
catch (SAMLException& e)
{
- log.errorStream() << "Error while parsing SAML metadata: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while parsing SAML metadata: " << e.what() << xmlproviders::logging::eol;
this->~XMLMetadataImpl();
throw;
}
}
catch(XSECException& e) {
auto_ptr_char msg(e.getMsg());
- log.errorStream() << "caught XMLSec exception while verifying metadata signature: " << msg.get() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught XMLSec exception while verifying metadata signature: " << msg.get() << xmlproviders::logging::eol;
if (sig)
prov.releaseSignature(sig);
return false;
}
catch(XSECCryptoException& e) {
- log.errorStream() << "caught XMLSecCrypto exception while verifying metadata signature: " << e.getMsg() << CategoryStream::ENDLINE;
+ log.errorStream() << "caught XMLSecCrypto exception while verifying metadata signature: " << e.getMsg() << xmlproviders::logging::eol;
if (sig)
prov.releaseSignature(sig);
return false;
unsigned long code=ERR_get_error_line_data(&file,&line,&data,&flags);
while (code) {
Category& log=Category::getInstance("OpenSSL");
- log.errorStream() << "error code: " << code << " in " << file << ", line " << line << CategoryStream::ENDLINE;
+ log.errorStream() << "error code: " << code << " in " << file << ", line " << line << xmlproviders::logging::eol;
if (data && (flags & ERR_TXT_STRING))
- log.errorStream() << "error data: " << data << CategoryStream::ENDLINE;
+ log.errorStream() << "error data: " << data << xmlproviders::logging::eol;
code=ERR_get_error_line_data(&file,&line,&data,&flags);
}
}
walker->release(); // This just cleans up aggressively, but there's no leak if we don't.
}
catch (SAMLException& e) {
- log.errorStream() << "Error while parsing trust configuration: " << e.what() << CategoryStream::ENDLINE;
+ log.errorStream() << "Error while parsing trust configuration: " << e.what() << xmlproviders::logging::eol;
this->~XMLTrustImpl();
throw;
}
buf[len] = '\0';
subjectstr+=buf;
}
- log.infoStream() << "certificate subject: " << subjectstr << CategoryStream::ENDLINE;
+ log.infoStream() << "certificate subject: " << subjectstr << xmlproviders::logging::eol;
// The flags give us LDAP order instead of X.500, with a comma plus space separator.
len=X509_NAME_print_ex(b2,subject,0,XN_FLAG_RFC2253 + XN_FLAG_SEP_CPLUS_SPC - XN_FLAG_SEP_COMMA_PLUS);
BIO_flush(b2);