Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardized dev options: enabled, transmit, output, verbose #456

Merged
merged 40 commits into from
May 3, 2019

Conversation

ArturMoczulski
Copy link
Contributor

@ArturMoczulski ArturMoczulski commented Apr 30, 2019

Closes #453

  • implements transmit (default: true) which makes the SDK skip calling send and sendBatch on sender objects
  • implements output (default: false) which makes the SDK dump the payload and Response object to the configured output_logger (default: \Monolog\Logger with \Monolog\Handler\ErrorLogHandler)
  • implements verbose (default: \Rollbar\Config::VERBOSE_NONE) which writes all verbose messages to configured verbose_logger (default: default: \Monolog\Logger with \Monolog\Handler\ErrorLogHandler)
    • values accepted by verbose config option are \Psr\Log\LogLevel values in compliance with https://tools.ietf.org/html/rfc5424 rather than custom config options suggested in the original spec
    • verbose supports \Rollbar\Config::VERBOSE_NONE which makes the SDK not verbose (except for output messages configured by a separate output option)
  • output_logger and verbose_logger are independent. output_logger is configurable solely with a boolean output config option; verbose_logger is configurable with \Psr\Log\LogLevel verbosity level
  • adds verbose messages (when appropriate level of verbose is set):
    • \Rollbar\RollbarLogger::log
      • info: Attempting to log: [$level] ... always
      • notice: Rollbar is disabled when enabled == false
      • error: Invalid log level '$level'. when invalid log level is passed to RollbarLogger
      • info: Occurrence ignored when an occurrence is ignored due to any reason covered by \Rollbar\Config::internalCheckIgnored
      • info: Occurrence ignored when an occurrence is ignored due to any reason covered by \Rollbar\Config::checkIgnore
      • error: Occurrence rejected by the SDK: $response when the SDK rejected the occurrence for any reason resulting in response status 0
      • error: Occurrence rejected by the API: $response when the API rejected the occurrence for any reason resulting in HTTP response status code 400+
      • info: Occurrence successfully logged always on successful report
    • \Rollbar\RollbarLogger::send
      • warning: Maximum number of items per request has been reached. If you want to report more items, please use max_items configuration option. when transmission stopped due to exceeding the max_items config option
      • debug: Added payload to the queue (running in batched mode). always when the occurrence is added to the queue (batched == true)
    • \Rollbar\RollbarLogger::flush
      • debug: Queue flushed always
    • \Rollbar\Config::shouldIgnoreError
      • debug: Ignore (error below allowed error_reporting level) when use_error_reporting == true and the PHP error's level is below configured PHP's error_reporting level
      • debug: Ignore due to included_errno level when PHP error's level is not included in configured included_errno
      • debug: Skip due to error sample rating when PHP error is skipped due to configured error_sample_rates
    • \Rollbar\Config::shouldIgnoreException
      • debug: Skip exception due to exception sample rating when an exception is skipped due to configured exception_sample_rates
    • \Rollbar\Config::checkIgnored
      • info: Occurrence ignored due to custom checkIgnore logic when an occurrence is ignored due to check_ignore callback evaluating to true
      • error: Exception occurred in the custom checkIgnore logic: $exceptionMessage when an exception is thrown in check_ignore callback
      • debug: Occurrence's level is too low when occurrence's level is below configured minimum_level
      • debug: Custom filter result: true/false always when filter is configured
    • \Rollbar\Config::send
      • warning: Not transmitting (transmitting disabled in configuration) when not transmitting due to transmit == false
    • \Rollbar\Config::sendBatch
      • warning: Not transmitting (transmitting disabled in configuration) when not transmitting due to transmit == false
    • \Rollbar\Config::internalCheckIgnored
      • debug: Ignoring (error reporting has been disabled in PHP config) when PHP's error_reporting === 0
      • debug: Occurrence's level is too low when occurrence's level is below configured minimum_level
    • \Rollbar\Config::handleResponse
      • debug: Applying custom response handler: get_class($this->responseHandler) when applying configured responseHandler
    • \Rollbar\Truncation\Truncation::truncate
      • debug: Applying truncation strategy get_class($strategy) always when applying a truncation strategy to payload
  • tests verbose messages

@ArturMoczulski ArturMoczulski added the Type: Enhancement Changes that add to, improve upon, enhance, or extend the existing component. label Apr 30, 2019
@ArturMoczulski ArturMoczulski self-assigned this Apr 30, 2019
@akornich
Copy link

akornich commented May 3, 2019

@ArturMoczulski , didn't we want to have a list of "EnvironmentsToTransmitFor" list option instead of the "Transmit" bool option?

@waltjones
Copy link
Contributor

@akornich I would prefer boolean wherever possible so the user can define their logic, which may be based on environment, but could be based on other logic. It also makes it more sensible for dynamically changing the value at runtime. This also means the SDK doesn't have to know what environments the app has defined.

See the example in this PR description: #449

Copy link
Contributor

@waltjones waltjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@ArturMoczulski
Copy link
Contributor Author

The response dump needs to get removed

Copy link

@akornich akornich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ArturMoczulski ArturMoczulski merged commit 0e33a6b into master May 3, 2019
@ArturMoczulski
Copy link
Contributor Author

@bishopb bishopb deleted the 453-standardize-dev-options branch December 31, 2020 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Changes that add to, improve upon, enhance, or extend the existing component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize enabled, transmit, output and verbose configuration options
4 participants