diff --git a/conans/model/conan_file.py b/conans/model/conan_file.py
--- a/conans/model/conan_file.py
+++ b/conans/model/conan_file.py
@@ -318,7 +318,7 @@ def generators_path(self) -> Path:
         return Path(self.generators_folder)
 
     def run(self, command, stdout=None, cwd=None, ignore_errors=False, env="", quiet=False,
-            shell=True, scope="build"):
+            shell=True, scope="build", stderr=None):
         # NOTE: "self.win_bash" is the new parameter "win_bash" for Conan 2.0
         command = self._conan_helpers.cmd_wrapper.wrap(command, conanfile=self)
         if env == "":  # This default allows not breaking for users with ``env=None`` indicating
@@ -332,7 +332,7 @@ def run(self, command, stdout=None, cwd=None, ignore_errors=False, env="", quiet
         from conans.util.runners import conan_run
         if not quiet:
             ConanOutput().writeln(f"{self.display_name}: RUN: {command}", fg=Color.BRIGHT_BLUE)
-        retcode = conan_run(wrapped_cmd, cwd=cwd, stdout=stdout, shell=shell)
+        retcode = conan_run(wrapped_cmd, cwd=cwd, stdout=stdout, stderr=stderr, shell=shell)
         if not quiet:
             ConanOutput().writeln("")
 

diff --git a/conans/test/functional/conanfile/runner_test.py b/conans/test/functional/conanfile/runner_test.py
--- a/conans/test/functional/conanfile/runner_test.py
+++ b/conans/test/functional/conanfile/runner_test.py
@@ -56,3 +56,18 @@ def source(self):
         client.save({"conanfile.py": conanfile})
         client.run("source .")
         self.assertIn('conanfile.py: Buffer got msgs Hello', client.out)
+
+    def test_custom_stream_stderr(self):
+        conanfile = textwrap.dedent("""
+            from io import StringIO
+            from conan import ConanFile
+            class Pkg(ConanFile):
+                def source(self):
+                    my_buf = StringIO()
+                    self.run('echo Hello 1>&2', stderr=my_buf)
+                    self.output.info("Buffer got stderr msgs {}".format(my_buf.getvalue()))
+            """)
+        client = TestClient()
+        client.save({"conanfile.py": conanfile})
+        client.run("source .")
+        self.assertIn('conanfile.py: Buffer got stderr msgs Hello', client.out)

Have `ConanFile.run()` be able to get `stderr` just like it does for `stdout`
Somestimes recipes call to programs that outùt important info to stderr instead of stdout, and Conan currently provides no good way to fetch that info


_Originally posted by @RubenRBS in https://github.com/conan-io/conan-center-index/pull/20979#discussion_r1395712850_
            

conans/test/functional/conanfile/runner_test.py::RunnerTest::test_custom_stream_stderr
conans/test/functional/conanfile/runner_test.py::RunnerTest::test_ignore_error conans/test/functional/conanfile/runner_test.py::RunnerTest::test_custom_stream_error conans/test/functional/conanfile/runner_test.py::RunnerTest::test_runner_capture_output