justeat / JustLog

JustLog brings logging on iOS to the next level. It supports console, file and remote Logstash logging via TCP socket with no effort. Support for logz.io available.
https://tech.justeattakeaway.com/
Apache License 2.0
519 stars 90 forks source link

Not able to see log on Kibana even after seeing `🔌 <AsyncSocket>, did write` #83

Closed sauvikaktivo closed 9 months ago

sauvikaktivo commented 4 years ago

Hi, Firstly thanks for this utility repository. i am facing issues to search log in Kibana.

I am using the following code, it's just an integration attempt to check everything is working fine.

The code base i am using:

struct LogDestinationLogStash: LogDestinationType {
    let logger = Logger.shared

    init(appID: String, enviroment: LogStashEnv) {
        // logstash destination
        logger.logstashHost = "https://my.aws.found.io"
        logger.logstashPort = 1111
        logger.logstashTimeout = 5
        logger.logLogstashSocketActivity = true

        // default info
        logger.defaultUserInfo = ["app": appID,
                                  "environment": enviroment.rawValue,
                                  "tenant": "UK",
                                  "sessionID": "someSessionID"]
        logger.setup()
    }
    func appendText(_ text: String) {
        Logger.shared.info(text, userInfo: ["some key": "some extra info"])
    }
}

The observation:

When executing Logger.shared.info(text, userInfo: ["some key": "some extra info"]), i can see some logs on my Xcode console.

2020-03-25 18:43:58.003  ℹ️ INFO: Home Screen: getHomeData Table view reloaded
2020-03-25 18:43:58.554  ℹ️ INFO: LoaderPermissionFlow screen removed from navigation controller
// and so on then
🔌 <AsyncSocket>, did write
🔌 <AsyncSocket>, did write
// SOME MORE log with `did write`
🔌 <AsyncSocket>, did write
🔌 <AsyncSocket>, did write
🔌 <AsyncSocket>, disconnected!
🔌 <AsyncSocket>, connected!
🔌 <AsyncSocket>, did secure
🔌 <AsyncSocket>, did write
🔌 <AsyncSocket>, disconnected!

The Issue

Based on this log i am assuming that logs written from my code was successfully uploaded to LogStash, but while searching i am not able to see them. But i can see logs coming from my account due to hitting some end points.

My Questions

  1. Do i missing any thing here?
  2. Is there any log on my console (or enabling DEBUG mode) will help me to have some log to be ensure that log is uploaded to ELK stack component LogStash?

Edit

When I change my host name to some wrong value, i get the following error

🔌 <AsyncSocket>, Could not startTLS: The operation couldn’t be completed. (JustLog.AsyncSocketManager.AsyncSocketError error 0.)
2020-03-25 19:12:47.581  ℹ️ INFO: Home Screen: getHomeData Table view reloaded
🔌 <AsyncSocket>, Could not connect: Attempting to connect while connected or accepting connections. Disconnect first.
🔌 <AsyncSocket>, Could not startTLS: The operation couldn’t be completed. (JustLog.AsyncSocketManager.AsyncSocketError error 0.)
🔌 <AsyncSocket>, Could not connect: Attempting to connect while connected or accepting connections. Disconnect first.
🔌 <AsyncSocket>, Could not startTLS: The operation couldn’t be completed. (JustLog.AsyncSocketManager.AsyncSocketError error 0.)
🔌 <AsyncSocket>, Could not connect: Attempting to connect while connected or accepting connections. Disconnect first.
🔌 <AsyncSocket>, Could not startTLS: The operation couldn’t be completed. (JustLog.AsyncSocketManager.AsyncSocketError error 0.)
🔌 <AsyncSocket>, disconnected with error: nodename nor servname provided, or not known
Error Domain=kCFStreamErrorDomainNetDB Code=8 "nodename nor servname provided, or not known" UserInfo={NSLocalizedDescription=nodename nor servname provided, or not known}
gigisommo commented 3 years ago

Hi @sauvikaktivo, is this still an issue for you?

albertodebortoli commented 9 months ago

Hi @sauvikaktivo and @gigisommo, I'm gonna go ahead and close this as we are deprecating the component and archiving the repo.