T4EA  18.2 C7549 A21431
Teamcenter Gateway for Enterprise Applications API Reference
LOGGING client functions

Functions

 tpco_getdefaultlogchannel
 This function gets the default logchannel for logmessages. More...
 
 tpco_setdlogchannel
 This function sets the default logchannel for logmessages. Don't change it in the T4x server-environment. More...
 
 tpco_udpDumpLogFile
 This function exports a logfile from the logserver. The tpco_udpDumpLogFile function works only in the BGS enviroment. For an external usage, use the TPRPC call ::LOGSRV::dumpLogFile. More...
 
 tpwrite
 This function writes a log message to the T4x BGS LogServer. More...
 

Detailed Description

Function Documentation

◆ tpco_getdefaultlogchannel()

tpco_getdefaultlogchannel

This function gets the default logchannel for logmessages.

Returns
the default log channel

Referenced by PL4X::CORE::getSessionLogChannel(), PL4X::CORE::setSessionLogChannel(), and T4X::TRANSLOG::startTransactionLog().

◆ tpco_setdlogchannel()

tpco_setdlogchannel

This function sets the default logchannel for logmessages. Don't change it in the T4x server-environment.

Parameters
logchannelthe default logchannel
Returns
none
1 tpco_setdlogchannel /tmp/xyz/thenewdefault.log

◆ tpco_udpDumpLogFile()

tpco_udpDumpLogFile

This function exports a logfile from the logserver. The tpco_udpDumpLogFile function works only in the BGS enviroment. For an external usage, use the TPRPC call ::LOGSRV::dumpLogFile.

Parameters
outtypestring (logfile translate to a UTF-8 string)
html (logfile translate to a HTML string)
native (internal use only)
sizethe last n-lines of the logfile. -1 = all lines
filenamethe name and path of the logfile
Returns
the logfile returns the logfile as a TCL list. 1 = cant export logfile
1 {
2  {mode {id subid} stacklevel ctime time-usec INTERN INTERN thid-hw thid-lw pid-hw pid-lw hostname client client-ip message}
3  {mode {id subid} stacklevel ctime time-usec INTERN INTERN thid-hw thid-lw pid-hw pid-lw hostname client client-ip message}
4  ...
5 }
6  mode: 0=DEBUG 1=ERROR 2=WARNING 3=NODE 4=OK 5=INTERN
7  id, subid message id and subid (multi line support)
8  ctime, time-usec message time ctime,time-usec

example: dump logfile in the BGS enviroment - last 10 lines as text output

1 puts [tpco_udpDumpLogFile text 10 /sys/nihil/BGS_20120705-133114/tpbgs.log]

example: dump logfile via network call - last 10 lines as text output

1 ::ProxyGen::createClientFor "BGS" 60 0 0 ::LOGSRV::dumpLogFile ::dumplog
2 set dump [::dumplog text 10 /sys/nihil/BGS_20120705-133114/tpbgs.log]
3 foreach logline $dump {
4  puts $logline
5  }
6 
7  output:
8  0 {77 0} 0 50016da4 c07bb 0 0 5cf73740 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {::tpcore::threadcreate :: StackSize=524288 TF=1}
9  5 {78 0} 0 50016da4 c7acc 0 0 31b78700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {set RCWD=/home/joerg/work/TR1480/tp_core_Linux_x86_64_debug}
10  5 {79 0} 0 50016da4 d6dcf 0 0 33afa700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {:: INIT BATCH SERVER API }
11  5 {7a 0} 0 50016da4 db48c 0 0 33afa700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {sys_01000000.sd :: TPDS FINISH}
12  5 {7b 0} 0 50016da4 f1143 0 0 31b78700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {:: INIT BATCH SERVER API }
13  5 {7c 0} 0 50016da4 f3f43 0 0 31b78700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {sys_01000000.sd :: TPDS FINISH}
14  3 {7e 0} 0 50016da5 75a67 0 0 5cf73740 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {USE CODE OPTIMATION PATH :: INTEL CC SSE4 CPUCODE=45 FEATURES=MMX SSE SSE2 SSE3 SSSE3 SSE41 SSE42 }
15  5 {7f 0} 0 50016dc2 a72ab 0 0 3282c700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {tpco_udpCleanLogStorage :: START LOGFILE - CLEANER}
16  5 {80 0} 0 50016dc4 5ebe1 0 0 3282c700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {tpco_udpCheckLogFile :: REMOVE DIRECTORY=/home/joerg/work/TR1480/tp_core_Linux_x86_64_debug/var/log/stdio}
17  5 {81 0} 0 50016dc4 a81b0 0 0 3282c700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {tpco_udpCleanLogStorage :: FINISH LOGFILE - CLEANER}
18  3 {83 0} 0 50016ddf c6d98 0 0 3abff700 7f6d 165c 0 {nihil} {tpbgs} {::ffff:127.0.0.1} {tpco_connhistMonitor :: INIT CONNECTION HISTORY DEPTH=1024}

◆ tpwrite()

tpwrite

This function writes a log message to the T4x BGS LogServer.

Parameters
logmessagethe logmessage (max size of the logmessage is 32 KByte)
-logchannel(optional) write the message in the defined logchannel. The default logchannel are defined with tpco_setdlogchannel. The logchannel is the relative path to the logroot.
-stacklevel(optional) indentation of the logmessage. Default= 0 range=0..63
-struct(optional) for internal use only
-mtype(optional) the type of the message (default=DEBUG)
DEBUG white
ERROR red
WARNING yellow/orange
INTERN grey
NOTE blue - use this for important messages
OK green
Returns
none - tpwrite works asynchronously

example: write a logmessage to the default logchannel.

1 tpwrite "Hello World"

example: write an error logmessage to the default logchannel.

1 tpwrite -mtype ERROR "Hello World"

example: write a "note" logmessage to the logchannel /tmp/xyz/new_debug.log

1 tpwrite -logchannel /tmp/xyz/new_debug.log -mtype NOTE "Hello World"

Referenced by T4X::MESSAGING::acknowledgeMessage(), CONFIGURATION::MANAGER::InstalledProductKeys::addProductKey(), SYSBase::aexec(), ITK::BOMLINE_cutbomline(), T4EA::GENBOM::CUSTOM::MAPPING::callCustomerRuleHandler(), T4X::CUSTOM::MAPPING::TOOLBOX::callCustomProc(), T4X::SOAP::CLIENT::callSoapOperation(), T4EA::CONNECTION2EA::CUSTOM::MAPPING::checkActiveEASystemForTargetTypeName(), T4X::BATCHJOB::DEPENDENCIES::checkBatchJobDependencies(), T4EA::CUSTOM::SERVICES::DEMOERP::checkConnection(), T4EA::JDBC::ORACLE::checkConnection(), T4EA::CUSTOM::SERVICES::checkConnection(), T4X::CONNECTION2EA::checkConnection2EA(), T4EA::PROP::MAPPING::checkConnection2EA4Session(), T4EA::CONNECTION2EA::CUSTOM::MAPPING::checkConnection2EA4Session(), T4EA::CONNECTION2EA::CUSTOM::MAPPING::checkConnection2EA4Transaction(), T4X::BATCHJOB::EXPORT::checkConnection2ERP(), T4X::BATCHJOB::IMPORT::checkConnection2ERP(), T4EA::checkEAPassword(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::cleanUp(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::cleanUp(), T4EA::BOM::CUSTOM::ITEM::IMPORT::cleanUp(), T4EA::JDBC::ORACLE::cleanupAllJdbcConnections(), T4EA::JDBC::ORACLE::cleanupJdbcConnection(), T4X::MESSAGING::closeAll(), T4X::MESSAGING::closeConnection(), API::Core::Batch::connect(), T4EA::CONNECTION2EA::CUSTOM::MAPPING::connectEA(), API::Core::Batch::connectTo(), T4X::BATCHJOB::EXPORT::createBatchjob(), T4X::BATCHJOB::IMPORT::createBatchjob(), T4X::TEST::WORKFLOW::createBatchJob4Workflow(), T4EA::JDBC::ORACLE::createJdbcMetafile(), T4X::BATCHJOB::EXPORT::createJob(), T4X::BATCHJOB::IMPORT::createJob(), T4EA::CUSTOM::ORACLE::createProductInformation(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::createTC_Object(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::createTC_Object(), T4EA::BOM::CUSTOM::ITEM::IMPORT::createTC_Object(), T4X::CUSTOM::MAPPING::TOOLBOX::createTC_Object2(), T4EA::BOM::CUSTOM::ITEM::IMPORT::createTCBOMview_Object(), T4EA::CUSTOM::SERVICES::DEMOERP::DemoERPService(), T4X::SOAP::CLIENT::deployShmemVariable(), T4EA::PROP::CUSTOM::MAPPING::displayOfbizFixedAsset(), T4EA::PROP::CUSTOM::MAPPING::displayOfbizProduct(), T4EA::PROP::CUSTOM::MAPPING::displayOracleProductInformation(), T4EA::PROP::CUSTOM::MAPPING::displaySoapArticle(), T4EA::PROP::CUSTOM::MAPPING::displaySoapDocument(), T4EA::GENBOM::CUSTOM::MAPPING::EA_Object2TC_Object(), PL4X::LOG::ENTER(), T4X::BATCHJOB::EXPORT::executeExportJob(), T4X::BATCHJOB::EXPORT::executeExportJob2(), T4X::BATCHJOB::IMPORT::executeImportJob(), T4X::BATCHJOB::IMPORT::executeImportJob2(), T4EA::QUERY::CUSTOM::MAPPING::executeQuery(), T4EA::QUERY::CUSTOM::MAPPING::executeQuery4OfbizProduct(), T4EA::QUERY::CUSTOM::MAPPING::executeQuery4ProductInformation(), T4X::SOA::executeTCSOACall(), T4X::TEST::WORKFLOW::executeTcWorkflowJob(), T4X::SOAP::CLIENT::existsShmemVariable(), T4X::TC::MAPPING::FieldMapping(), T4X::TC::MAPPING::findIndexedObjectId4Value(), T4X::TC::MAPPING::findIndexedObjectList4Attribute(), T4X::TC::MAPPING::findObjectId4Value(), T4X::TC::MAPPING::findObjectList(), T4X::TC::MAPPING::findObjectList4Value(), T4X::TC::MAPPING::findRootTaskObjectList(), findStartedSuccessorTask(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::GenObjMapping2TC_Object(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::GenObjMapping2TC_Object(), T4EA::PROP::CUSTOM::MAPPING::getArrayDataSave(), getBinLogFile(), T4EA::JDBC::ORACLE::getConnectionHandle4System(), T4X::SOA::getConnectionParameters(), T4EA::BOM::CUSTOM::ITEM::IMPORT::getCurrentTcBomInfo(), T4X::BATCHJOB::DEPENDENCIES::getDependencyStatus(), T4X::BATCHJOB::TOOLBOX::getDictValue(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_Article(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_BillOfMaterial(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_Document(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_FixedAsset(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_Product(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_ProductAssociation(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_ProductDocument(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_ProductInformation(), T4EA::PROP::CUSTOM::MAPPING::GetEAData_QueryResultObject(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::getERPOutputData(), T4EA::PROP::MAPPING::getExternalDataView(), T4EA::BOM::CUSTOM::ITEM::IMPORT::getImportBomInfo(), T4EA::getLocalizationString(), T4X::TC::MAPPING::getObjectAttributeValue(), ITK::getObjectData(), T4EA::CUSTOM::ORACLE::getObjectInfo(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::getObjectInfo(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::getObjectInfo(), T4EA::GENBOM::CUSTOM::MAPPING::getObjectInfo(), T4X::TC::MAPPING::getObjectsValueList(), T4X::TC::MAPPING::getPreferenceValue(), T4X::TC::MAPPING::getQueryArgumentValue(), ITK::getReleatedObjectTag2(), T4X::XML::PARSER::getResultArrayInfo(), T4X::TC::MAPPING::getRootTaskFieldMappingValueList(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::getTargetRevisionFromList(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::getTargetRevisionFromList(), T4EA::BOM::CUSTOM::ITEM::IMPORT::getTargetRevisionFromList(), T4EA::CONNECTION2EA::CUSTOM::MAPPING::getTargetTypeNames4Connection(), T4EA::GENBOM::CUSTOM::MAPPING::getTcData(), T4X::TRANSLOG::getTransLogFile(), T4X::TC::MAPPING::getWorkflowArgumentValue2(), T4X::TC::MAPPING::getWorkflowArgumentValue3(), T4EA::PROP::CUSTOM::MAPPING::getXmlData(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::getXmlData(), T4X::BATCHJOB::EXPORT::handleBatchJob(), T4X::BATCHJOB::IMPORT::handleBatchJob(), T4EA::BOM::CUSTOM::ITEM::IMPORT::importBOM2TcBOM(), T4X::CUSTOM::MAPPING::TOOLBOX::importNamedReference(), T4EA::QUERY::CUSTOM::MAPPING::importQueryRowViaBatch(), T4X::TC::MAPPING::IndexedFieldMapping(), T4EA::JDBC::ORACLE::initJdbcConnection(), PL4X::LOG::LEAVE(), SYSBase::loadLibrary(), PL4X::LOG::LOG(), T4EA::CUSTOM::ORACLE::logException(), T4X::BATCHJOB::TOOLBOX::logStatusInfo(), T4X::TNT::logTestReport(), T4X::TestingSupport::logTestReport(), T4X::CORE::matchStringWithRegExp(), T4EA::CUSTOM::SERVICES::ofBIZservice(), T4EA::CUSTOM::SERVICES::ofBIZservice4BillOfMaterial(), T4EA::CUSTOM::SERVICES::ofBIZservice4Document(), T4EA::CUSTOM::SERVICES::ofBIZservice4getAssociatedProducts(), T4EA::CUSTOM::SERVICES::ofBIZservice4Product(), T4X::SOA::performEBSCall(), T4X::SOA::performGenericWebServiceCall(), T4X::SOA::performGenericWebServiceCall2(), T4X::SOA::performGenericWebServiceCallFireAndForget(), T4X::SOA::performSAPBAPICall(), T4X::SOA::performSAPESCall(), T4EA::GENBOM::CUSTOM::MAPPING::performTransfer(), T4EA::CUSTOM::SERVICES::prepareStatus(), T4X::TC::MAPPING::printIndexTcData(), T4X::TC::MAPPING::printTcBomLineData(), T4X::TC::MAPPING::printTcData(), T4X::TC::MAPPING::printTcRootTaskData(), T4X::CONNECTION2EA::readConnectionInfo4Session(), T4X::MESSAGING::receiveMessage(), T4X::TC::MAPPING::RootTaskFieldMapping(), T4X::TC::MAPPING::save_unlockTcObject(), T4X::CUSTOM::MAPPING::TOOLBOX::saveItemWithUnlock(), T4X::CONNECTION2EA::selectActiveConnection2EA(), T4X::CUSTOM::MAPPING::TOOLBOX::selectTC_Object(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::selectTC_Object(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::selectTC_Object(), T4EA::BOM::CUSTOM::ITEM::IMPORT::selectTC_Object(), T4X::CUSTOM::MAPPING::TOOLBOX::selectTC_ScheduleObject(), T4EA::BOM::CUSTOM::ITEM::IMPORT::selectTCBOMview_Object(), T4X::MESSAGING::sendBinaryMessage(), EMail::sendmail2(), T4X::MESSAGING::sendStringMessage(), T4X::BATCHJOB::DEPENDENCIES::setBatchJobDependencies(), T4X::BATCHJOB::TOOLBOX::setBatchjobStatus(), ITK::MULTI::CONNECT::setConnectParameters4Batch(), ITK::MULTI::CONNECT::setConnectParameters4WF(), SYSBase::sexec(), T4X::MESSAGING::startConnection(), T4X::TRANSLOG::startTransactionLog(), T4X::TRANSLOG::stopTransactionLog(), storeBinLogFile(), T4X::CORE::storeMessage2(), T4X::CORE::storeMessage2DatasetLogfile(), T4X::CORE::storeUserMessage(), T4EA::GENBOM::CUSTOM::MAPPING::TC_Object2EA_Object(), T4EA::GENBOM::CUSTOM::MAPPING::TC_Object2EA_ObjectPosition(), testLogPattern(), tp_crashexit(), T4EA::CUSTOM::ORACLE::updateProductInformation(), T4X::BATCHJOB::IMPORT::updateStatus4ZTableId(), T4EA::GENOBJ::CUSTOM::OBJECT::IMPORT::updateTC_Object(), T4EA::GENOBJ::CUSTOM::PRODUCT_INFORMATION::IMPORT::updateTC_Object(), T4EA::BOM::CUSTOM::ITEM::IMPORT::updateTC_Object(), T4X::TRANSLOG::writeArrayLog(), T4X::TRANSLOG::writeBomLineMappingStatusLog(), T4X::TRANSLOG::writeCustomMappingLog(), T4X::TRANSLOG::writeCustomMappingStatusLog(), T4X::TRANSLOG::writeCustomReverseMappingLog(), T4X::TRANSLOG::writeCustomReverseMappingStatusLog(), T4X::TRANSLOG::writeImportStatusInfoLog(), T4X::CORE::writeLogLineWithAttachment2BGS(), T4X::TRANSLOG::writeMultiClassTransferMappingLog(), T4X::TRANSLOG::writeMultiInspectionControlTransferMappingLog(), T4X::TRANSLOG::writeMultiStatusDictLog(), T4X::TRANSLOG::writeMultiStatusLog(), T4X::TRANSLOG::writeMultiTransferMappingLog(), T4X::TRANSLOG::writeMultiTransferStartLog(), T4X::TRANSLOG::writePlainInfoLog(), T4X::TRANSLOG::writeStatusDictLog(), T4X::TRANSLOG::writeStatusIntoMessageDetails(), T4X::TRANSLOG::writeStatusLog(), T4X::TRANSLOG::writeTcSysLogFileEntry(), T4X::BATCHJOB::TOOLBOX::writeTcUser2LogIndex(), T4X::BATCHJOB::IMPORT::writeTransactionLog(), T4X::CORE::writeVersionInfo2LogChannel(), and T4X::TRANSLOG::writeVersionInfo2TransactionLog().