Skip to content
English
  • There are no suggestions because the search field is empty.

Ably client SDK verbose logs

In order to enable verbose logging in your clients, please refer to the ClientOptions documentation at https://ably.com/documentation/realtime/usage#client-options and refer to the "logLevel" or "log" options. 


You can see examples of how to enable verbose logs in the Ably SDKs client options

ably-js

ably-java

ably-go

ably-cocoa (swift)

ably-dotnet

ably-php

ably-python

ably-ruby (realtime)

ably-ruby (rest)

ably-flutter

laravel-broadcaster

 

ably-js

v1.x.x

var ably = new Ably.Realtime(
{ /* existing options */,
log: { level: 4 }
});

v2.x.x

var ably = new Ably.Realtime(
{ /* existing options */,
logLevel:4
});

ably-java

ClientOptions clientOptions = new ClientOptions(); 
/* existing options */
clientOptions.logLevel = Log.VERBOSE;
ablyRealtime = new AblyRealtime(clientOptions);

ably-go

client, err := ably.NewRealtime(/*existing options*/,ably.WithLogLevel(4))
  if err != nil {
        panic(err)
  }

ably-cocoa (swift)

let clientOptions = ARTClientOptions();
/* existing options */
clientOptions.logLevel = .debug;
let realtime = ARTRealtime(options: clientOptions);

ably-dotnet


https://github.com/ably/ably-dotnet#enable-logging

ably-php

$clientOptions = array( 
/* existing options */,
'logLevel' => 4, );

$ably = new \Ably\AblyRest($clientOptions);

ably-python

https://docs.python.org/3/library/logging.html

Tip: Add a formatter object to log timestamps eg.

formatter = logging.Formatter('%(asctime)s - %(message)s')

handler.setFormatter(formatter)

this will help if we need to correlate timestamps from the client with the ably realtime platform

import logging
import ably

ablyLog = logging.getLogger('ably')
ablyLog.setLevel(logging.DEBUG)
ablyLog.addHandler(logging.StreamHandler())

ably-ruby (realtime)

ably = Ably::Realtime.new(=begin existing client options =end, log_level: :debug)

ably-ruby (rest)

clientOptions = {=begin existing client options =end, log_level: :debug} 
ably = Ably::Rest.new(client_options)

ably-flutter

import 'package:ably_flutter/ably_flutter.dart' as ably;

var clientOptions = ably.ClientOptions(/* existing client options */,
logLevel: ably.LogLevel.verbose);

laravel-broadcaster

Add logLevel to the broadcasting.php file

'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
'disable_public_channels' => env('ABLY_DISABLE_PUBLIC_CHANNELS', false),
'token_expiry' => env('ABLY_TOKEN_EXPIRY', 3600),
'logLevel' => 4

],