rich handler refactor
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0416e448e..e64c64527 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Added tracebacks_show_locals parameter to RichHandler
 - Applied dim=True to indent guide styles
 - Added max_string to Pretty
+- Factored out RichHandler.get_style_and_level to allow for overriding in subclasses
 - Added rich.ansi.AnsiDecoder
 - Added decoding of ansi codes to captured stdout in Progress
 - Hid progress bars from html export
diff --git a/rich/_log_render.py b/rich/_log_render.py
index b966244f7..3cc739af0 100644
--- a/rich/_log_render.py
+++ b/rich/_log_render.py
@@ -16,11 +16,13 @@ def __init__(
         show_level: bool = False,
         show_path: bool = True,
         time_format: str = "[%x %X]",
+        level_width: Optional[int] = 8,
     ) -> None:
         self.show_time = show_time
         self.show_level = show_level
         self.show_path = show_path
         self.time_format = time_format
+        self.level_width = level_width
         self._last_time: Optional[str] = None
 
     def __call__(
@@ -42,7 +44,7 @@ def __call__(
         if self.show_time:
             output.add_column(style="log.time")
         if self.show_level:
-            output.add_column(style="log.level", width=8)
+            output.add_column(style="log.level", width=self.level_width)
         output.add_column(ratio=1, style="log.message", overflow="fold")
         if self.show_path and path:
             output.add_column(style="log.path")
diff --git a/rich/logging.py b/rich/logging.py
index b96ed4454..b3c8c1b5f 100644
--- a/rich/logging.py
+++ b/rich/logging.py
@@ -72,7 +72,10 @@ def __init__(
         self.console = console or get_console()
         self.highlighter = highlighter or self.HIGHLIGHTER_CLASS()
         self._log_render = LogRender(
-            show_time=show_time, show_level=show_level, show_path=show_path
+            show_time=show_time,
+            show_level=show_level,
+            show_path=show_path,
+            level_width=None,
         )
         self.enable_link_path = enable_link_path
         self.markup = markup
@@ -83,17 +86,29 @@ def __init__(
         self.tracebacks_word_wrap = tracebacks_word_wrap
         self.tracebacks_show_locals = tracebacks_show_locals
 
+    def get_level_text(self, record: LogRecord) -> Text:
+        """Get the level name from the record.
+
+        Args:
+            record (LogRecord): LogRecord instance.
+
+        Returns:
+            Text: A tuple of the style and level name.
+        """
+        level_name = record.levelname
+        level_text = Text.styled(
+            level_name.ljust(8), f"logging.level.{level_name.lower()}"
+        )
+        return level_text
+
     def emit(self, record: LogRecord) -> None:
         """Invoked by logging."""
         path = Path(record.pathname).name
-        log_style = f"logging.level.{record.levelname.lower()}"
+        level = self.get_level_text(record)
         message = self.format(record)
         time_format = None if self.formatter is None else self.formatter.datefmt
         log_time = datetime.fromtimestamp(record.created)
 
-        level = Text()
-        level.append(record.levelname, log_style)
-
         traceback = None
         if (
             self.rich_tracebacks
diff --git a/rich/rule.py b/rich/rule.py
index ad393d20b..6ac88f70a 100644
--- a/rich/rule.py
+++ b/rich/rule.py
@@ -1,4 +1,4 @@
-from typing import Optional, Union
+from typing import Union
 
 from .cells import cell_len, set_cell_size
 from .console import Console, ConsoleOptions, RenderResult
diff --git a/rich/scope.py b/rich/scope.py
index 725ffa27f..67393595c 100644
--- a/rich/scope.py
+++ b/rich/scope.py
@@ -1,13 +1,11 @@
-from typing import Any, Tuple, TYPE_CHECKING
-
 from collections.abc import Mapping
+from typing import TYPE_CHECKING, Any, Tuple
 
 from .highlighter import ReprHighlighter
 from .panel import Panel
 from .pretty import Pretty
-from .text import Text, TextType
 from .table import Table
-
+from .text import Text, TextType
 
 if TYPE_CHECKING:
     from .console import ConsoleRenderable, RenderableType

Factored out method RichHandler.get_style_and_level to allow overriding in subclasses.