[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eThis documentation addresses errors encountered during API proxy deployment in Apigee and Apigee hybrid related to the MessageLogging policy.\u003c/p\u003e\n"],["\u003cp\u003eThe "Invalid Protocol" error occurs when the \u003ccode\u003e<Protocol>\u003c/code\u003e element in the MessageLogging policy is set to an unsupported value, such as HTTP, and must be either TCP or UDP.\u003c/p\u003e\n"],["\u003cp\u003eThe "Invalid Port" error arises when the \u003ccode\u003e<Port>\u003c/code\u003e element in the MessageLogging policy is set to 0 or is missing, requiring it to be an integer greater than zero.\u003c/p\u003e\n"],["\u003cp\u003eTo resolve these errors, one needs to identify the specific MessageLogging policy mentioned in the error message and then correct either the \u003ccode\u003e<Protocol>\u003c/code\u003e or \u003ccode\u003e<Port>\u003c/code\u003e elements in the configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe valid values for the Protocol element are TCP and UDP, and the valid values for the Port are any integer number greater than 0.\u003c/p\u003e\n"]]],[],null,["# Message Logging policy deployment error troubleshooting\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/policies/deployment/message-logging-deployment-errors) documentation.*\n| Was this troubleshooting playbook helpful? Please let us know by clicking [Send Feedback]().\n\nInvalidProtocol\n---------------\n\n### Error message\n\nDeployment of an API proxy through either the Apigee UI or API fails with this error message: \n\n```\nError Saving Revision revision_number\nInvalid Protocol: invalid_protocol for Syslog handler in policy policy_name.\n```\n\n### Example error message\n\n Error Saving Revision 4\n Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.\n\n### Example screenshot\n\n### **Cause**\n\nThe deployment of the [MessageLogging policy](/apigee/docs/api-platform/reference/policies/message-logging-policy) policy can fail with this error if the protocol specified within the `\u003cProtocol\u003e` element is not valid. The valid protocols are TCP and UDP. For sending syslog messages over TLS/SSL, only TCP is supported.\n\nFor example, the deployment of the API Proxy fails with this error if you specify HTTP in the `\u003cProtocol\u003e` element of the MessageLogging Policy as shown below: \n\n \u003cProtocol\u003eHTTP\u003c/Protocol\u003e\n\n### **Diagnosis**\n\n1. Identify the MessageLogging policy where the error occurred. You can find this information in the error message. For example, in the following error, the policy name is `LogToSyslog:`\n\n Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.\n\n2. In the failed MessageLogging policy configuration check if the protocol specified within the `\u003cProtocol\u003e` element is valid. If there is an invalid protocol specified, then that's the cause of the error.\n\n For example, the following policy specifies an invalid protocol. \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cMessageLogging name=\"LogToSyslog\"\u003e\n \u003cSyslog\u003e\n \u003cMessage\u003e[3f509b58 tag=\"{organization.name}.{apiproxy.name}.{environment.name}\"] Weather request for WOEID {request.queryparam.w}.\u003c/Message\u003e\n \u003cHost\u003elogs-01.loggly.com\u003c/Host\u003e\n \u003cPort\u003e514\u003c/Port\u003e\n \u003cProtocol\u003eHTTP\u003c/Protocol\u003e\n \u003cFormatMessage\u003etrue\u003c/FormatMessage\u003e\n \u003c/Syslog\u003e\n \u003clogLevel\u003eALERT\u003c/logLevel\u003e\n \u003c/MessageLogging\u003e\n\n Because the protocol defined within the `\u003cProtocol\u003e` element is invalid, the deployment of the API Proxy fails with the error: \n\n Invalid Protocol: HTTP for Syslog handler in policy LogToSyslog.\n\n### Resolution\n\nEnsure that the protocol defined within the `\u003cProtocol\u003e` element of the MessageLogging policy is valid. The `\u003cProtocol\u003e`\nelement supports the following values:\n\n- TCP\n- UDP\n\nTo correct the example shown above, define a valid protocol within the `\u003cProtocol\u003e` element: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cMessageLogging name=\"LogToSyslog\"\u003e\n \u003cSyslog\u003e\n \u003cMessage\u003e[3f509b58 tag=\"{organization.name}.{apiproxy.name}.{environment.name}\"] Weather request for WOEID {request.queryparam.w}.\u003c/Message\u003e\n \u003cHost\u003elogs-01.loggly.com\u003c/Host\u003e\n \u003cPort\u003e514\u003c/Port\u003e\n \u003cProtocol\u003eTCP\u003c/Protocol\u003e\n \u003cFormatMessage\u003etrue\u003c/FormatMessage\u003e\n \u003c/Syslog\u003e\n \u003clogLevel\u003eALERT\u003c/logLevel\u003e\n \u003c/MessageLogging\u003e\n\nInvalidPort\n-----------\n\n### Error message\n\nDeployment of an API proxy through either the Apigee UI or API fails with this error message: \n\n```\nError Saving Revision revision_number\nInvalid Port: 0 for Syslog handler in policy policy_name.\n```\n\n### Example error message\n\n Error Saving Revision 4\n Invalid Port: 0 for Syslog handler in policy LogToSyslog.\n\n### Example screenshot\n\n### Cause\n\nThe deployment of the [MessageLogging policy](/apigee/docs/api-platform/reference/policies/message-logging-policy) can fail with this error if the port number is not specified within the `\u003cPort\u003e` element or if it is not valid. The port number must be an integer greater than zero.\n\nFor example, if the `\u003cPort\u003e` element is declared as shown below, the deployment of the API proxy fails: \n\n \u003cPort\u003e0\u003c/Port\u003e\n\n### Diagnosis\n\n1. Identify the MessageLogging policy where the error occurred. You can find this information from the error message. For example, in the following error, the policy name is `LogToSyslog:`\n\n Invalid Port: 0 for Syslog handler in policy LogToSyslog.\n\n2. In the failed MessageLogging policy check if a valid port number is specified within the `\u003cPort\u003e` element. If the port number is not defined or is invalid, then that's the cause of the error.\n\n For example, the following policy specifies an invalid port number: \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cMessageLogging name=\"LogToSyslog\"\u003e\n \u003cSyslog\u003e\n \u003cMessage\u003e[3f509b58 tag=\"{organization.name}.{apiproxy.name}.{environment.name}\"] Weather request for WOEID {request.queryparam.w}.\u003c/Message\u003e\n \u003cHost\u003elogs-01.loggly.com\u003c/Host\u003e\n \u003cPort\u003e0\u003c/Port\u003e\n \u003cProtocol\u003eTCP\u003c/Protocol\u003e\n \u003cFormatMessage\u003etrue\u003c/FormatMessage\u003e\n \u003c/Syslog\u003e\n \u003clogLevel\u003eALERT\u003c/logLevel\u003e\n \u003c/MessageLogging\u003e\n\n Because the port number defined within the `\u003cPort\u003e` element is invalid, the deployment of the API Proxy fails with the error: \n\n Invalid Port: 0 for Syslog handler in policy LogToSyslog.\n\n### Resolution\n\nEnsure that a port number is defined within the `\u003cPort\u003e` element of the MessageLogging policy. It has to be an integer greater than zero.\n\nTo correct the example shown above, define a valid port number within the `\u003cProtocol\u003e` element. \n\n \u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?\u003e\n \u003cMessageLogging name=\"LogToSyslog\"\u003e\n \u003cSyslog\u003e\n \u003cMessage\u003e[3f509b58 tag=\"{organization.name}.{apiproxy.name}.{environment.name}\"] Weather request for WOEID {request.queryparam.w}.\u003c/Message\u003e\n \u003cHost\u003elogs-01.loggly.com\u003c/Host\u003e\n \u003cPort\u003e514\u003c/Port\u003e\n \u003cProtocol\u003eTCP\u003c/Protocol\u003e\n \u003cFormatMessage\u003etrue\u003c/FormatMessage\u003e\n \u003c/Syslog\u003e\n \u003clogLevel\u003eALERT\u003c/logLevel\u003e\n \u003c/MessageLogging\u003e"]]